Skip to content

Instantly share code, notes, and snippets.

View worried-networking's full-sized avatar

Andrew Y. worried-networking

View GitHub Profile
@worried-networking
worried-networking / README.md
Last active April 1, 2020 19:54
Workaround for openhab/openhab2-addons#3522

This script monitors openhab log for messages like Terminating homekit connection and New homekit connection and saving connection state to specified MQTT. I'm running it with following parameters:

python3 homekiter.py --mqtt_host wb.286.su --mqtt_topic_prefix /custom/homekit_connected --logfile /usr/src/logs/openhab.log

In the openhab I have created following things and items:

Thing exec:command:openhab_refresh_homekit [ command="ssh -i /openhab/conf/id_rsa openhab@localhost -p 8101 bundle:refresh org.openhab.io.homekit", interval=0, autorun=false ]

Keybase proof

I hereby claim:

  • I am andrey-yantsen on github.
  • I am virus (https://keybase.io/virus) on keybase.
  • I have a public key whose fingerprint is 25AA D6CF FACF 348E A28D 288B 2571 2C9E 747F AE22

To claim this, I am signing this object:

@worried-networking
worried-networking / README.md
Last active December 5, 2025 21:56
Binge-watching scripts for sonarr+plex

Summary

Normally, when you're watching a TV-Show — you don't need all its episodes right away; you just need a few for the next hour or so. The following scripts help you with exactly this! plex-autotag.py marks the new shows you add with tag keep1; plex-autodelete.py removes watched episodes from your drive; sonarr-refresher.py triggers sonarr to download few new episodes, to keep you always having your next fix. All in all — sonarr will download you a new episode after you've watched one.

All this magic works only for "main" user.

The autodelete script was originally taken from plex-api and then it was modified to remove only watched episodes, plus I've added a couple of tags.

It would've been better to make the sonarr script to work directly with Plex API instead of relying on the deleted files, but I'm not there yet.

{
"home_assistant": {
"installation_type": "Home Assistant Container",
"version": "2022.2.0b0",
"dev": false,
"hassio": false,
"virtualenv": false,
"python_version": "3.9.7",
"docker": true,
"arch": "x86_64",
@worried-networking
worried-networking / Plugin logic.js
Last active January 22, 2023 13:55
Roborock S7 status debug
if (this.state == RobotState.CHARGING && !this.isCleanMopMoppingMode() && this.cleanResumeFlag != CleanResumeFlag.None && !this.hasShownChargingResumeCleanReminder) {
if (this.notDisturbEnabled) {
reminders = reminders.concat('chargingResumeNoDisturbClean');
} else {
reminders = reminders.concat('chargingResumeClean');
}
this.hasShownChargingResumeCleanReminder = true;
}