Openhab is publishing my analog data (temperatures, etc.) nicely to my MQTT Broker but the subscribing client can’t use discrete values in the form of opened / closed or off/on - it needs 0 or 1
Although this works for analog values I would like to so something similar for Boolean sending 0/1 and can’t figure out how?
// Imports
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import org.joda.time.*
// Global Variables
// Temperature
rule "My MQTT Rules: Relay BasementTemp"
when
Item BasementTemp changed
then
publish("mybroker","o/ment/temperature",BasementTemp.state.toString)
logInfo("INFO","My MQTT Rules: Relay BasementTemp completed.")
end
any similar “publish” command that would convert this text to a boolean?