# Tasmota flashed Window Sensor ON/OFF to true/false? MQTT

**URL:** <https://community.homey.app/t/tasmota-flashed-window-sensor-on-off-to-true-false-mqtt/47761>\
**Category:** Questions & Help\
**Created:** [May 24, 2021, 6:38pm UTC](https://community.homey.app/t/tasmota-flashed-window-sensor-on-off-to-true-false-mqtt/47761 "2021-05-24T18:38:56Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)\
**Post date:** [May 25, 2021, 5:43pm UTC](https://community.homey.app/t/tasmota-flashed-window-sensor-on-off-to-true-false-mqtt/47761/8 "2021-05-25T17:43:38Z")

</div>

Just create an MQTT Device and add a ‘Turned On/Off’ capability pointing to the correct state & command topics of your tasmota device.

Then you have two options to solve your problem:

1. Either configure the input and output templates like this:  
input: value == ‘on’  
output: value ? ‘on’ : ‘off’  

2. Or leave the input & output templates empty. After creating the device, go to the advanced device config and select ‘on/off’ for the ‘on/off values’ setting (true/false in screenshot), this will automatically convert boolean values to ‘on’ & ‘off’ in both directions.  

Marh.js expression examples can be found here:  
[https://mathjs.org/](https://mathjs.org/)

You can use ‘path.to.property’ I stead of ‘value’ within the templates, if the input is a JSON formatted message.

---

_[View the full topic](https://community.homey.app/t/tasmota-flashed-window-sensor-on-off-to-true-false-mqtt/47761)._
