13 July 2020
blog diy nodemcu hass domotique tasmota
Exemple de configuration donnée :
# Example configuration.yaml entry
sensor:
- platform: mqtt
name: "Timer 1"
state_topic: "tele/sonoff/sensor"
value_template: "{{ value_json.Timer1.Arm }}"
json_attributes_topic: "tele/sonoff/sensor"
json_attributes_template: "{{ value_json.Timer1 | tojson }}"
- platform: mqtt
name: "Timer 2"
state_topic: "tele/sonoff/sensor"
value_template: "{{ value_json.Timer2.Arm }}"
json_attributes_topic: "tele/sonoff/sensor"
json_attributes_template: "{{ value_json.Timer2 | tojson }}"
D'autres informations plus génériques :
sensor:
- platform: mqtt
name: "Tasmota Temperature"
state_topic: "tele/tasmota/SENSOR"
value_template: "{{ value_json['DHT22'].Temperature }}"
unit_of_measurement: "°C" # "F" if using Fahrenheit
availability_topic: "tele/tasmota/LWT"
payload_available: "Online"
payload_not_available: "Offline"
device_class: temperature
- platform: mqtt
name: "Tasmota Humidity"
state_topic: "tele/tasmota/SENSOR"
value_template: "{{ value_json['DHT22'].Humidity }}"
unit_of_measurement: "%"
availability_topic: "tele/tasmota/LWT"
payload_available: "Online"
payload_not_available: "Offline"
device_class: humidity
$ mosquitto_sub -t "#" -v |grep tasmota
tele/tasmota_5FBCCA/LWT Connecté
tele/tasmota_B2431F/LWT Connecté
tele/tasmota_B2431F/STATE {"Time":"2020-07-13T16:38:49","Uptime":"1T01:50:11","UptimeSec":93011,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"Wifi_HNL_IV_2263","BSSId":"F4:CA:E5:E3:9B:48","Channel":10,"RSSI":100,"Signal":-33,"LinkCount":1,"Downtime":"0T00:00:05"}}
tele/tasmota_5FBCCA/STATE {"Time":"2020-07-13T16:39:17","Uptime":"0T00:05:13","UptimeSec":313,"Heap":28,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Wifi_HNL_IV_2263","BSSId":"F4:CA:E5:E3:9B:48","Channel":10,"RSSI":100,"Signal":-24,"LinkCount":1,"Downtime":"0T00:00:07"}}
tele/tasmota_5FBCCA/SENSOR {"Time":"2020-07-13T16:39:17","SI7021":{"Temperature":26.7,"Humidity":39.9,"DewPoint":11.9},"TempUnit":"C"}
Le contenu du topic tele/tasmota_5FBCCA/SENSOR
:
{
"Time":"2020-07-13T16:39:17",
"SI7021":
{
"Temperature":26.7,
"Humidity":39.9,
"DewPoint":11.9
},
"TempUnit":"C"
}
# HNL sensor configuration
sensor:
- platform: mqtt
name: "Tasmota Temperature"
state_topic: "tele/tasmota_5FBCCA/SENSOR"
value_template: "{{ value_json['SI7021'].Temperature }}"
unit_of_measurement: "°C" # "F" if using Fahrenheit
availability_topic: "tele/tasmota_5FBCCA/SENSOR"
payload_available: "Online"
payload_not_available: "Offline"
device_class: temperature
- platform: mqtt
name: "Tasmota Humidity"
state_topic: "tele/tasmota_5FBCCA/SENSOR"
value_template: "{{ value_json['SI7021'].Humidity }}"
unit_of_measurement: "%"
availability_topic: "tele/tasmota_5FBCCA/SENSOR"
payload_available: "Online"
payload_not_available: "Offline"
device_class: humidity