NodeJS automated ShellyPlug toggle at semi random times
An Automation Script for toggling an ShellyPlugs Output at random Times of Day.
- Shelly Plug S
Prerequisites include:
Installation:
- Clone this Repository
- Execute
pnpm install
Usage:
- Copy
config.example.json
toconfig.json
- Edit
config.json
to your liking. (Refer to Config - Start with
pnpm start
The config is an array of config objects:
Structure Visualisation:
[ // <-- Array Opening
{ // <<-- Config Object
},
{ // <<-- Config Object
}
] // <-- Array Closing
This is a action that switches the ShellyPlug on at 192.168.33.1 between 10:00 and 10:30.
{
"ip": "192.168.33.1",
"action": "on",
"time": {
"startHour": 10,
"startMinute": 0,
"minuteRange": 30,
"weekDays": []
},
"shelly": {
"username": "admin",
"password": "test"
}
}
This should be a string containing the ip of the ShellyPlug you want to target with this action.
This is a string which should be on of these actions (case-sensitive):
on
turning ShellyPlug onoff
turning ShellyPlug offtoggle
toggling the current state of the ShellyPlug
This is an object containing the start time and range of the randomization.
The hour mark at which the randomization range starts. This is a number. This should be in the 24h format.
The minute mark within the hour at which the randomization range starts. This is a number.
The range in minutes in which it randomizes from the start time. This is a number.
An array of numbers on which weekdays this action should happen. (Weekdays are with numbers not with names, so use 1 for Monday, 2 for Tuesday, and so on.)
This is an object containing the credentials for the shelly plug.
This is the username for the ShellyPlug, the default from ShellyPlugs for this is admin
. This is a string.
This is the password for the ShellyPlug. This is a string.