Skip to content

Commit

Permalink
Adding more PlusPlugS properties
Browse files Browse the repository at this point in the history
  • Loading branch information
enesbcs committed May 9, 2023
1 parent 1ca89c6 commit 7b68c24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ git clone https://github.com/enesbcs/shellyteacher4domo.git
```
In case you want to save the configurations after rebooting, please make sure that MQTT broker [persistence settings](https://pagefault.blog/2020/02/05/how-to-set-up-persistent-storage-for-mosquitto-mqtt-broker/) configured correctly!

## How to update to program
## How to update the program
First: save your templates.txt files if you modified it, than:
```
git pull
Expand Down
6 changes: 6 additions & 0 deletions mqtt_templates_gen2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ topic=%discovery_prefix%/switch/%shelly_id%-0/config
payload={"name": "%shelly_topic% Relay 0", "cmd_t": "~rpc", "pl_off": "{\"id\":1,\"src\":\"%shelly_id%\",\"method\":\"Switch.Set\",\"params\":{\"id\":0,\"on\":false}}", "pl_on": "{\"id\":1,\"src\":\"%shelly_id%\",\"method\":\"Switch.Set\",\"params\":{\"id\":0,\"on\":true}}", "stat_t": "~status/switch:0", "val_tpl": "{{ value_json.output }}","stat_off": "false","stat_on": "true","avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "%shelly_id%-0", "qos": 0, "device": {"identifiers": ["%shelly_mac%"],"manufacturer": "Shelly","model": "%shelly_model%","name": "%shelly_id%"}, "~": "%shelly_topic%/"}
topic=%discovery_prefix%/sensor/%shelly_id%-0/temperature/config
payload={"name": "%shelly_id% Temperature", "frc_upd": "false", "enabled_by_default": true, "uniq_id": "%shelly_id%-temperature", "qos": 0, "~":"%shelly_topic%/", "entity_category": "diagnostic", "dev_cla": "temperature", "stat_cla": "measurement", "unit_of_meas": "°C","stat_t": "~status/switch:0", "val_tpl": "{{ value_json['temperature'].tC }}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
topic=%discovery_prefix%/sensor/%shelly_id%-0/voltage/config
payload={"name": "%shelly_id% Voltage 0", "~": "%shelly_topic%/", "stat_t": "~status/switch:0", "frc_upd": "false", "enabled_by_default": true, "uniq_id": "%shelly_id%-0-voltage", "qos": 0, "dev_cla": "voltage", "stat_cla": "measurement", "unit_of_meas": "V", "val_tpl": "{{ value_json.voltage }}", "device": {"identifiers": ["%shelly_mac%-0"],"manufacturer": "Shelly","model": "%shelly_model%","name": "%shelly_id%-0"}}
topic=%discovery_prefix%/sensor/%shelly_id%-0/power/config
payload={"name": "%shelly_id% Power 0", "stat_t": "~status/switch:0", "frc_upd": "false", "enabled_by_default": true, "uniq_id": "%shelly_id%-0-power", "qos": 0, "~": "%shelly_topic%/", "dev_cla": "power", "stat_cla": "measurement", "unit_of_meas": "W", "val_tpl": "{{ value_json.apower }}", "device": {"identifiers": ["%shelly_mac%-0"],"manufacturer": "Shelly","model": "%shelly_model%","name": "%shelly_id%-0"}}
topic=%discovery_prefix%/sensor/%shelly_id%-0/energy/config
payload={"name": "%shelly_id% Energy 0", "stat_t": "~status/switch:0", "frc_upd": "false", "enabled_by_default": false, "uniq_id": "%shelly_id%-0-energy", "qos": 0, "~": "%shelly_topic%/", "dev_cla": "energy", "stat_cla": "total_increasing", "unit_of_meas": "Wh", "val_tpl": "{{ value_json['aenergy'].total|float/60)|round(2) }}", "device": {"identifiers": ["%shelly_mac%-0"],"manufacturer": "Shelly","model": "%shelly_model%","name": "%shelly_id%-0"}}

[shellyplusi4] # Shelly Plus I4
topic=%discovery_prefix%/binary_sensor/%shelly_id%-0/input/config
Expand Down

0 comments on commit 7b68c24

Please sign in to comment.