* [mqtt.homeassistant] Fix jinja usage in availability templates
Use the local Jinjava, instead of implicitly depending on the Jinja
transformation service.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
While it's useful in general to not have to copy/paste a MQTT message into a JSON
parser to verify syntax, it also includes details about fields that are the wrong
data type that a generic JSON parser won't catch. A la #17375.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] Improve support for Lock component
* handle state and command payloads differing (as they do by default)
* expose full state possibilities and OPEN command by adding
a TextValue channel
* Recognize intermediate lock states as unlocked on the switch channel
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] add support for Update component
This component is fairly non-standard - it doesn't add any channels.
Instead, it provides several properties to the thing, and also adds
a thing configuration allowing you to trigger an OTA update on a
Home Assistant device from MainUI.
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] improve Cover support
* Add support for covers that report position
* Handle when command and state values for OPEN/CLOSE/STOP
differ (as they do by default)
* Expose the full cover state, since it can have tell you
if the cover is moving or not
* Handle covers that have a position only, but not a state
* add constants to clarify up/down values
* Be sure to parse percents from strings in RollshutterValue
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] interpret a dimmable light as OFF properly from zigbee2mqtt
zigbee2mqtt can send a brightness of say 99, with a state of OFF, when a bulb is
off. make sure if state is sent, it overrides all other inferences
* handle brightness but not color bulbs
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>
I.e. Button, Scene, and Binary Sensors.
Also ensure we set up the CommandDescription, since some value types mights use it.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] Add support for Button component
* use a StringValue instead of an OnOffValue
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Follow on to #15427
ring-mqtt sends `"name": ""`, not `"name": null` or simply omitting it,
so be sure to handle that way as well
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] handle null component name
channels from such components will not have a group. this is
now done by zigbee2mqtt for the "default" component of a device,
such as the light. HASS encourages this as of release 2023.8
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] support color temp on JSON schema lights
also adds a color_mode channel if color temp is possible, so you can
know how the bulb is behaving
* put color mode channel construction into buildChannels()
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>