* [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>
the min/max from the config are specifically only for the set point.
i.e. for a heater in winter when the heater is off, it may have
a set point range of 65-104°F, but if it's off for an unoccopied room
the ambient temperature might drop far below 65
Signed-off-by: Cody Cutrer <cody@cutrer.us>
https://github.com/openhab/openhab-addons/pull/12238 was merged after
JSON Schema Light was implemented, and changed some assumptions.
this commit adjusts to the changed interface
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] implement JSON schema lights
* [mqtt.homeassistant] use enum for current state of color mode
* [mqtt.homeassistant] use implicit lambdas
* [mqtt.homeassistant] remove string constants in favor of an enum
* [mqtt.homeassistant] allow sending ON and brightness commands through bare
* [mqtt.homeassistant] turn down debug logging
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] support command_template for fan components
* [mqtt.homeassistant] fix field declaration for consistency
Signed-off-by: Cody Cutrer <cody@cutrer.us>
openHAB doesn't have the concept of "enabled by default", since _everything_
is technically "disabled" until you link it to an item. It seems devices
use disabled by default on less common entities, such as zigbee2mqtt
marking a binary_sensor as a "backup" method to an update entity for
when an update is available, or a sensor as a "backup" method to a
select entity. So in that case, just hiding these channels unless the user
clicks "Show Advanced" seems to map best.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
To mitigate issue https://github.com/openhab/openhab-core/issues/3125
(common thread pool exhaustion when combining parallel streams with
synchronization or locks)
Signed-off-by: Sami Salonen <ssalonen@gmail.com>
* [mqtt.homeassistant] support non-RGB lights
dynamically decide which type of channel to expose. also send "down-typed"
commands to the proper topic. this also sets the groundwork for supporting
template and JSON schemas
Signed-off-by: Cody Cutrer <cody@cutrer.us>
So that other pieces of openhab can know what unit it's going to be,
without it having a value yet. Importantly, any necessary conversion
that need to be applied to the other portion of the state description -
min, max, and step.
See also https://github.com/openhab/openhab-core/pull/3132
Signed-off-by: Cody Cutrer <cody@cutrer.us>
HASS registers availability topics before calling start(), so
the AbstractMQTTThingHandler was never subscribing/starting the
availability channel(s). So do so in start() of the base class.
I checked other implementations, and either they already handle
re-registering availabilityTopics in their start()
(GenericMQTTThingHandler), or they don't use availabilityTopics
at all from the base class and manage it themselves (Homie).
Note that this shows up as newly-added HASS things not having
a problem (because the components aren't discovered until after
the ThingHandler is started), but if you restart OpenHAB or
disable/enable the thing, the channels (and components) are
cached, thus how availabilityTopics are known before starting.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.openassistant] Better labels for discoverd things
This PR introduces more simple label for things, instead of
"My Sensor (Sensor, Sensor, Sensor, Sensor, Sensor, Switch)" we have
simply "Me Sensor (5x Sensor, Switch)".
Signed-off-by: Sami Salonen <ssalonen@gmail.com>
see reference in code comment, but a measurement sensor is assumed to
be numeric, even if it doesn't have a unit
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] Stable jsondb serialization for discovery results
Similar to openhab/openhab-core#2436, we want
to have consistent ordering of data in JSONDB. This is fixing the jsondb
order for mqtt.homeassistant discovery results, specifically, the
"topics" property.
* [mqtt.homeassistant] order using full topic string, not by subcomponent
Signed-off-by: Sami Salonen <ssalonen@gmail.com>
* New translations googletts.properties (French)
* New translations googlestt.properties (French)
* New translations voskstt.properties (French)
* New translations watsonstt.properties (French)
* New translations pollytts.properties (French)
* New translations mqtt.properties (French)
* New translations mqtt.properties (French)
* New translations porcupineks.properties (French)
* New translations bluetooth.properties (Finnish)
* New translations danfossairunit.properties (Danish)
* New translations hdpowerview.properties (Danish)
* New translations jruby.properties (Italian)
* New translations miele.properties (Danish)
* New translations mqtt.properties (Italian)
* New translations openwebnet.properties (Italian)
* New translations openweathermap.properties (Italian)
* New translations openweathermap.properties (German)
* New translations icalendar.properties (Italian)
* New translations network.properties (German)
* New translations atlona.properties (Italian)
* New translations yeelight.properties (Italian)
* New translations yioremote.properties (Italian)
* New translations astro.properties (German)
* New translations deconz.properties (German)
* New translations deconz.properties (Italian)
* New translations pollytts.properties (German)
* New translations mqtt.properties (Italian)
* New translations publictransportswitzerland.properties (Italian)
* New translations mqtt.properties (Italian)
* New translations mqtt.properties (Italian)
* New translations ipp.properties (German)
* Add UOM for MQTT Channels
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Fix dependencies
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Simplify units parsing, remove channelUID from NumberValue constructor
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Simplify pattern
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Fix tests
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Correct Units reference
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Correct homeassistant binding changes
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Wrap precision in temperature unit definition
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Use BigDecimal for precision
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Use BigDecimal throughout
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Fix SAT
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Inverty equals check
Signed-off-by: James Melville <jamesmelville@gmail.com>
* Add default translations for binding add-ons
This makes the texts used by these add-ons translatable with Crowdin.
To keep the PR simple, it only adds default translations for add-ons which do not yet have any default translations properties file.
We can do follow up PRs for adding missing key/values to add-ons that already have these files or to remove duplications.
There are several add-ons in this PR that do have non-English translation files, so I'll upload those to Crowdin when the PR is merged.
Signed-off-by: Wouter Born <github@maindrain.net>
While integrating the review comments, I did not remember that some
variable names are written as they are because they result from some
deserialization.
This small PR fixes this.
Signed-off-by: Stefan Triller <github@stefantriller.de>
* Implement Vacuum discovery for Homeassistant MQTT
Closes#8988
Signed-off-by: Stefan Triller <github@stefantriller.de>
* Addressed review comments
Signed-off-by: Stefan Triller <github@stefantriller.de>
* Spotless run again
Signed-off-by: Stefan Triller <github@stefantriller.de>
* Update imports to use JUnit 5 instead of JUnit 4
* Add commonly used JUnit 4 classes to forbidden packages
Related to: https://github.com/openhab/openhab-core/pull/2534
Signed-off-by: Wouter Born <github@maindrain.net>
* MQTT.Homeassistant Climate support
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant synthetic config test added
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant refactoring
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant discovery test added
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant thing handler test added
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant switch test added
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant Climate test added
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant author header added
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant copyright header added
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant test fixed
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant test fixed
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant test infrastructure updated. Added tests with mqtt publishing and commands posting.
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant fixed Climate#send_if_off handling
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant do not filter the power command
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant climate unit test added
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* Update bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/DiscoverComponents.java
Redundant annotation removed
Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
* MQTT.Homeassistant Redundant @Nullable annotations removed
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant Unit tests added for all components
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant Unit tests stability fix
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant @NonNullByDefault removed from Device, config.dto package created
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant Climate author added
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant Device.sw_version renamed
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
* MQTT.Homeassistant tests wait timeout increased to 10s
Signed-off-by: Anton Kharuzhy <antroids@gmail.com>
Co-authored-by: antroids <antroids@gmail.com>
Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
* Reworks many commons-lang usages to use standard Java
* Updates all remaining commons.lang imports to commons.lang3
Related to openhab/openhab-addons#7722
Signed-off-by: Wouter Born <github@maindrain.net>
* Updates links to target the openhab-addons 'main' branch instead of the 'master' branch
* Updates some NOTICE files to indicate content is maintained by openHAB instead of Eclipse SmartHome
Signed-off-by: Wouter Born <github@maindrain.net>