├── screenshot.png ├── LICENSE └── README.md /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfdlr/homeassistant-wlanthermo/HEAD/screenshot.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Martin Fiedler 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WLANThermo for Home Assistant 2 | 3 | The WLANThermo bbq thermometer (https://wlanthermo.de/) uses a local wifi and optional MQTT server to push the temperature changes to. 4 | 5 | ## Setup MQTT in WLANThermo 6 | Link your WLANThermo to the same MQTT server which Home Assistant is using. You can do this easily on the provided web interface. 7 | 8 | 9 | ## Home Assistant Configuration 10 | 11 | ### Sensor 12 | First we add a sensor containing all information, battery status as master value. We force it to expire after 1 minute of no new MQTT message, which leads Home Assistant to set the status to `Unknown`. 13 | 14 | Adjust your MQTT topic appropriately, so change the topic prefix `WLanThermo/NANO-2a21b5` to your modelname. 15 | 16 | ```yaml 17 | sensor: 18 | # Basic sensor, read everything from MQTT 19 | - platform: mqtt 20 | name: "WLANThermo" 21 | # change topic to your modelname! 22 | state_topic: "WLanThermo/NANO-2a21b5/status/data" 23 | value_template: "{{ value_json.system.soc }}" 24 | # change topic to your modelname! 25 | json_attributes_topic: "WLanThermo/NANO-2a21b5/status/data" 26 | json_attributes_template: "{{ value_json | tojson }}" 27 | device_class: battery 28 | unit_of_measurement: "%" 29 | expire_after: 60 30 | 31 | # Template sensor per channel 32 | - platform: template 33 | sensors: 34 | # Wifi signal strength 35 | wlanthermo_signal_strength: 36 | value_template: "{{ state_attr('sensor.wlanthermo', 'system')['rssi'] }}" 37 | unit_of_measurement: "dBm" 38 | friendly_name: "WLANThermo signal strength" 39 | device_class: signal_strength 40 | entity_id: sensor.wlanthermo 41 | 42 | # Channel 1 43 | wlanthermo_channel_1_all: 44 | value_template: "{{ state_attr('sensor.wlanthermo', 'channel')[0] }}" 45 | entity_id: sensor.wlanthermo 46 | wlanthermo_channel_1: 47 | friendly_name_template: > 48 | {% if not is_state('sensor.wlanthermo', 'unknown') %} 49 | {{ state_attr('sensor.wlanthermo', 'channel')[0]['name'] }} 50 | {% else %} 51 | Channel 1 52 | {% endif %} 53 | # set to zero if wlanthermo is turned off or channel not plugged in 54 | value_template: > 55 | {% if not is_state('sensor.wlanthermo', 'unknown') %} 56 | {% set temp = state_attr('sensor.wlanthermo', 'channel')[0]['temp'] %} 57 | {% if temp >= -30 and temp <= 300 %} 58 | {{ temp }} 59 | {% else %} 60 | 0 61 | {% endif %} 62 | {% else %} 63 | 0 64 | {% endif %} 65 | unit_of_measurement: "°C" 66 | device_class: temperature 67 | entity_id: sensor.wlanthermo 68 | 69 | # Channel 2 70 | wlanthermo_channel_2_all: 71 | value_template: "{{ state_attr('sensor.wlanthermo', 'channel')[1] }}" 72 | entity_id: sensor.wlanthermo 73 | wlanthermo_channel_2: 74 | friendly_name_template: > 75 | {% if not is_state('sensor.wlanthermo', 'unknown') %} 76 | {{ state_attr('sensor.wlanthermo', 'channel')[1]['name'] }} 77 | {% else %} 78 | Channel 1 79 | {% endif %} 80 | # set to zero if wlanthermo is turned off or channel not plugged in 81 | value_template: > 82 | {% if not is_state('sensor.wlanthermo', 'unknown') %} 83 | {% set temp = state_attr('sensor.wlanthermo', 'channel')[1]['temp'] %} 84 | {% if temp >= -30 and temp <= 300 %} 85 | {{ temp }} 86 | {% else %} 87 | 0 88 | {% endif %} 89 | {% else %} 90 | 0 91 | {% endif %} 92 | unit_of_measurement: "°C" 93 | device_class: temperature 94 | entity_id: sensor.wlanthermo 95 | 96 | # add further channels here... 97 | ``` 98 | 99 | 100 | 101 | ### Input Number 102 | Now we need to define input_number elements, so that we are able to control a slider in the UI. 103 | 104 | ```yaml 105 | input_number: 106 | wlanthermo_channel_1_min: 107 | name: Channel 1 min 108 | min: 0 109 | max: 100 110 | step: 1 111 | unit_of_measurement: °C 112 | icon: mdi:thermometer 113 | wlanthermo_channel_1_max: 114 | name: Channel 1 max 115 | min: 0 116 | max: 150 117 | step: 1 118 | unit_of_measurement: °C 119 | icon: mdi:thermometer 120 | wlanthermo_channel_2_min: 121 | name: Channel 2 min 122 | min: 0 123 | max: 100 124 | step: 1 125 | unit_of_measurement: °C 126 | icon: mdi:thermometer 127 | wlanthermo_channel_2_max: 128 | name: Channel 2 max 129 | min: 0 130 | max: 150 131 | step: 1 132 | unit_of_measurement: °C 133 | icon: mdi:thermometer 134 | ``` 135 | 136 | ### Automations (updating sensor values) 137 | In the automations you have to define how to set the defined input_number elements (we want to use the values which are coming from MQTT) and what to do if someone changes the slider in the UI (we want to update the WLANThermo). 138 | 139 | ```yaml 140 | # First automation: set Home Assistant sensor value from MQTT messages, so we 141 | # update if someone changes the values on web interface 142 | - id: '1565774399160' 143 | alias: WLANThermo update channels min/max from MQTT 144 | trigger: 145 | - entity_id: sensor.wlanthermo 146 | platform: state 147 | condition: [] 148 | action: 149 | - data_template: 150 | entity_id: input_number.wlanthermo_channel_1_min 151 | value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').0.min }}' 152 | service: input_number.set_value 153 | - data_template: 154 | entity_id: input_number.wlanthermo_channel_1_max 155 | value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').0.max }}' 156 | service: input_number.set_value 157 | - data_template: 158 | entity_id: input_number.wlanthermo_channel_2_min 159 | value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').1.min }}' 160 | service: input_number.set_value 161 | - data_template: 162 | entity_id: input_number.wlanthermo_channel_2_max 163 | value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').1.max }}' 164 | service: input_number.set_value 165 | 166 | # automation per input_number: update value set in Lovelace UI on WLANThermo 167 | - id: '1565867288673' 168 | alias: WLANThermo set channel 1 min 169 | trigger: 170 | - entity_id: input_number.wlanthermo_channel_1_min 171 | platform: state 172 | condition: [] 173 | action: 174 | - service: mqtt.publish 175 | data_template: 176 | topic: WLanThermo/NANO-2a21b5/set/channels 177 | retain: true 178 | payload: '{{ ''{"number":1,"min":''+states(''input_number.wlanthermo_channel_1_min'')+''}'' 179 | }}' 180 | 181 | # automation per input_number: update value set in Lovelace UI on WLANThermo 182 | - id: '1565867288674' 183 | alias: WLANThermo set channel 1 max 184 | trigger: 185 | - entity_id: input_number.wlanthermo_channel_1_max 186 | platform: state 187 | condition: [] 188 | action: 189 | - service: mqtt.publish 190 | data_template: 191 | topic: WLanThermo/NANO-2a21b5/set/channels 192 | retain: true 193 | payload: '{{ ''{"number":1,"max":''+states(''input_number.wlanthermo_channel_1_max'')+''}'' 194 | }}' 195 | 196 | # automation per input_number: update value set in Lovelace UI on WLANThermo 197 | - id: '1565867288675' 198 | alias: WLANThermo set channel 2 min 199 | trigger: 200 | - entity_id: input_number.wlanthermo_channel_2_min 201 | platform: state 202 | condition: [] 203 | action: 204 | - service: mqtt.publish 205 | data_template: 206 | topic: WLanThermo/NANO-2a21b5/set/channels 207 | retain: true 208 | payload: '{{ ''{"number":2,"min":''+states(''input_number.wlanthermo_channel_2_min'')+''}'' 209 | }}' 210 | 211 | # automation per input_number: update value set in Lovelace UI on WLANThermo 212 | - id: '1565867288676' 213 | alias: WLANThermo set channel 2 max 214 | trigger: 215 | - entity_id: input_number.wlanthermo_channel_2_max 216 | platform: state 217 | condition: [] 218 | action: 219 | - service: mqtt.publish 220 | data_template: 221 | topic: WLanThermo/NANO-2a21b5/set/channels 222 | retain: true 223 | payload: '{{ ''{"number":2,"max":''+states(''input_number.wlanthermo_channel_2_max'')+''}'' 224 | }}' 225 | 226 | # add additional channels here... 227 | ``` 228 | 229 | ### Lovelace configuration 230 | ![Screenshot Lovelace UI WLANThermo](/screenshot.png?raw=true "WLANThermo Lovelace") 231 | 232 | ```yaml 233 | - title: Thermometer 234 | icon: 'mdi:pig' 235 | cards: 236 | - type: entities 237 | entities: 238 | - entity: sensor.wlanthermo 239 | - type: history-graph 240 | entities: 241 | - entity: sensor.wlanthermo_channel_1 242 | - entity: sensor.wlanthermo_channel_2 243 | title: Temperaturverlauf 244 | - type: conditional 245 | conditions: 246 | - entity: sensor.wlanthermo_channel_1 247 | state_not: '0' 248 | - entity: sensor.wlanthermo_channel_1 249 | state_not: unavailable 250 | card: 251 | type: vertical-stack 252 | cards: 253 | - type: gauge 254 | entity: sensor.wlanthermo_channel_1 255 | min: 0 256 | max: 250 257 | severity: 258 | green: 90 259 | yellow: 115 260 | red: 200 261 | - type: entities 262 | entities: 263 | - entity: input_number.wlanthermo_channel_1_min 264 | - entity: input_number.wlanthermo_channel_1_max 265 | - type: conditional 266 | conditions: 267 | - entity: sensor.wlanthermo_channel_2 268 | state_not: '0' 269 | - entity: sensor.wlanthermo_channel_2 270 | state_not: unavailable 271 | card: 272 | type: vertical-stack 273 | cards: 274 | - type: gauge 275 | entity: sensor.wlanthermo_channel_2 276 | min: 0 277 | max: 100 278 | severity: 279 | green: 0 280 | yellow: 0 281 | red: 0 282 | - type: entities 283 | entities: 284 | - entity: input_number.wlanthermo_channel_2_min 285 | - entity: input_number.wlanthermo_channel_2_max 286 | ``` 287 | --------------------------------------------------------------------------------