Commit Graph

40 Commits (38cfa83e23c17f61907b7354b0a103519b8c65b1)

Author SHA1 Message Date
Jan Bouwhuis 5afe8fd2db
Revert "Add MQTT notify platform (#64728)" (#68505)
This reverts commit e574a3ef1d.
2022-03-22 12:51:24 +01:00
Jan Bouwhuis e574a3ef1d
Add MQTT notify platform (#64728)
* Mqtt Notify service draft

* fix updates

* Remove TARGET config parameter

* do not use protected attributes

* complete tests

* device support for auto discovery

* Add targets attribute and support for data param

* Add tests and resolve naming issues

* CONF_COMMAND_TEMPLATE from .const

* Use mqtt as default service name

* make sure service  has a unique name

* pylint error

* fix type error

* Conditional device removal and test

* Improve tests

* update description has_notify_services()

* Use TypedDict for service config

* casting- fix discovery - hass.data

* cleanup

* move MqttNotificationConfig after the schemas

* fix has_notify_services

* do not test log for reg update

* Improve casting types

* Simplify obtaining the device_id

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* await not needed

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Improve casting types and naming

* cleanup_device_registry signature change and black

* remove not needed condition

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-03-08 16:27:18 +01:00
rubenverhoef 95de1dd446
Additional MQTT light command templates (#63361)
Co-authored-by: jbouwh <jan@jbsoft.nl>
2022-02-22 00:00:49 +01:00
Diogo Gomes de2734bd0e
add entity_category (#66377) 2022-02-16 16:34:21 +01:00
Jan Bouwhuis 6fdaec0847
Add MQTT siren platform (#64440)
* Add mqtt siren draft

* fix tests

* Intergrate notify platform

* tests and fixes siren platform

* Add tests notify platform

* config parameters and abbreviations

* remove duplicate key

* undo move topic abbreviation

* Move const CONF_MESSAGE_COMMAND_TEMPLATE

* Remove notify service integration

* Rework

* Update homeassistant/components/mqtt/siren.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Publish JSON by default

* Allow unknown state - rename value_template

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-01-31 10:31:57 +01:00
Jan Bouwhuis 3307e54363
Add MQTT availability template and encoding (#60470)
* Add MQTT availability template and encoding

* use generic encoding field

* pylint and cleanup

* remove additional topic check
2021-12-02 10:21:31 +01:00
Jan Bouwhuis 2a2a20fcb3
Add mqtt sensor configurable state encoding for sensor and binary_sensor platform (#60447)
* Add mqtt sensor state encoding

* Make encoding attribute not specific to states

* Move encoding attribute to schema base
2021-11-30 14:04:24 +01:00
Raphaël Beamonte 8600b5597a
Add 'trigger' support for MQTT Alarm Control Panel (#60525)
When configuring an Alarm Control Panel through MQTT discovery, it
was not possible to use the trigger service. This fixes that by making
it available the same way as ARM and DISARM services are.
2021-11-29 14:41:52 +01:00
Erik Montnemery b5ce84cd89
Add MQTT button (#59348) 2021-11-09 12:04:14 +01:00
Damien Duboeuf 67c2747027
Add MQTT object_id option (#58728)
* Add MQTT object_id option

* Add MQTT object_id option

* Add MQTT object_id option

* Add MQTT object_id option - Fix light and vacuum

* Add MQTT object_id option - Fix light and vacuum

* Add MQTT object_id option - Fix lock

* Add MQTT object_id option - Fix device

* Add MQTT object_id option - Fix device

* Update tests/components/mqtt/test_discovery.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Change deprecated method

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-11-08 14:02:18 +01:00
Maciej Bieniek 0aa06d22f1
Move `configuration_url` abbreviation to MQTT `DEVICE_ABBREVIATIONS` const (#58313) 2021-10-24 11:35:46 +02:00
Franck Nijhof eed9f67402
Add service configuration URL to MQTT (#57731) 2021-10-14 18:27:40 -07:00
Erik Montnemery 7223c59e79
Allow resetting an MQTT number (#57161)
* Allow resetting an MQTT number

* Add abbreviation
2021-10-07 13:54:34 +02:00
posixx 547ede1e91
Implementation of new Vacation mode for MQTT-based alarm panels (#53561)
* Impelentation of new Vacation Mode for MQTT-based alarm panels

* Fixed typo

* another typo fix

* Split integrations: remove manual_mqtt

* added newline

* Impelentation of new Vacation Mode for MQTT-based alarm panels

* Fixed typo

* another typo fix

* Split integrations: remove manual_mqtt

* added newline

* missing abbreviation

* Fix tests

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-08-24 13:22:49 +02:00
Jan Bouwhuis c9eab10134
Add MQTT humidifier platform integration (#52828)
* New mqtt humidifier platform

* Add humidifier platform

* Leave out humidity step

* Use humidity in constant for payload reset

* change TARGET_HUMIDITY_RESET payload name

* _attr_max_humidity not assigned correctly

* _target_humidity_range has a zero base

* align CONF_TARGET_HUMIDITY_MIN and MAX  with model

* shorter topics for humidity_range

* Converts float to int from template

* new humidifier abbreviations

* Add common module to support tests

* Add tests

* Addtional testing

* Always require target_humidity_command_topic

* Typo

* use available_modes to align entity model

* use avail_modes not modes to avoid conflict

* typo target_humidity_value_template

* Allign modes and templates with climate platform

* mode_state_template

* target_humidity_state_template

* Typo in platform name

* Remove humidity_range feature and common lib

* Update homeassistant/components/mqtt/humidifier.py

Use vol.In, not regex

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* black

* Update homeassistant/components/mqtt/humidifier.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Use round to convert float to target humidity

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-07-15 11:12:23 +02:00
Erik Montnemery 4533a77597
Add MQTT select (#52120)
* Add MQTT select

* Fix value_template support

* Lint
2021-06-24 17:09:06 +02:00
Erik Montnemery 52c142a82d
Add support for color_mode white to MQTT light basic schema (#51484)
* Add support for color_mode white to MQTT light basic schema

* Add missing abbreviations
2021-06-22 11:59:20 +02:00
Erik Montnemery 789a14fc44
Add support for last_reset to MQTT sensor (#51036)
* Add support for last_reset to MQTT sensor

* Update abbreviations

* Improve test coverage
2021-05-26 11:50:29 +02:00
Erik Montnemery 870c61a622
Add color_mode support to MQTT light with basic schema (#50464)
* Add color_mode support to MQTT light with basic schema

* Update abbreviations

* Silence pylint

* Improve test coverage

* Apply suggestions from code review
2021-05-24 11:37:02 +02:00
Erik Montnemery dc65f279a7
Add support for state_class to MQTT sensor (#50927) 2021-05-21 17:37:26 +02:00
Shay Levy 6e087039f4
Add min/max/step to MQTT number (#50869) 2021-05-21 18:35:27 +03:00
Jan Bouwhuis 9abf43f95f
Mqtt fan feature for resetting current speed `percentage` or `preset_mode` (#50565)
* Mqtt fan resetting speed percentage or preset_mode

* tests reset payload is working with val templates

* Remove duplicate line for CONF_PAYLOAD_HIGH_SPEED
2021-05-18 08:24:42 +02:00
Erik Montnemery c7584a1f92
Add color_mode support to MQTT JSON light (#47993) 2021-03-31 11:28:45 +02:00
Erik Montnemery 8ad3c65645
Allow MQTT entities to be disabled by default (#48284)
* Allow MQTT entities to be disabled by default

* Tweak
2021-03-30 00:09:14 +02:00
Jan Bouwhuis d8a4cf63f4
Command template support for MQTT fan (#48413)
* Command template support

* Fix typo in abbreviations

* Update homeassistant/components/mqtt/fan.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Fix initialize templates

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-03-29 20:41:51 +02:00
Jan Bouwhuis 5b17aaf9d5
Percentage and preset mode support for MQTT fan (#47944)
* git push --all origin

* Fix percentage to ordered list conversion

* Tests for mqtt fan and fixes

* Improve tests and error handling base config

* Additional tests

* Tests completed, small fixes

* Allow preset mode and percentages combined

* Remove raise in setup and update tests

* Alignment with fan entity mode

* Fix pylint for len-as-condition

* Remove python binary cache file from PR

* Additional tests on async_turn_on and fix

* Added comments for deprecation of speeds

* Schema checks before init

* Optimize pre schema checks

* Correct schema checks

* Update homeassistant/components/mqtt/abbreviations.py

Comment speeds for mqtt fan are deprecated not needed here

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/fan.py

Comment speeds for mqtt fan are deprecated not needed here

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/fan.py

Comment speeds for mqtt fan are deprecated not needed here

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/fan.py

Comment speeds for mqtt fan are deprecated not needed here

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/fan.py

Comment speeds for mqtt fan are deprecated not needed here

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Warnings for exceptions - testing speed_range

* Update homeassistant/components/mqtt/abbreviations.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/fan.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/fan.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/fan.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/fan.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/fan.py

* Save with black

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-03-26 08:37:47 +01:00
RadekHvizdos 9f4c2f6260
Add suggested_area to MQTT discovery (#47903)
* Add suggested_area to MQTT Discovery

This adds suggested_area to MQTT discovery, so that the discovered devices could be automatically added to the proper area.

* Add abbreviation for MQTT suggested_area

* Remove extra whitespace

* Remove extra whitespace #2

* Added tests for MQTT Dicovery of suggested_area

* Fix test for MQTT suggested_area

* Better tests of MQTT suggested_area

Changes made as per feedback from @emontnemery
2021-03-15 20:02:02 +01:00
Shay Levy 81c88cd639
Enhance MQTT cover platform (#46059)
* Enhance MQTT cover platform

Allow combining of position and state of MQTT cover
Add template and fix optimistic in set tilt position
Add tests

* Add abbreviations

* Add tests and stopped state

* Cleanup & fix range for templates

* Apply suggestions from code review

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-02-08 16:02:12 +01:00
radovanbauer baab9b9a81
Added command templates for the mqtt climate component. (#44976)
This allows integrating with devices which require more complex payloads to be posted when updating their values.

Old feature request: https://github.com/home-assistant/core/issues/11496
There are numerous posts requesting this feature, example: https://community.home-assistant.io/t/need-help-with-value-template-for-mqtt-hvac/73395/68https://community.home-assistant.io/t/need-help-with-value-template-for-mqtt-hvac/73395/68

Command templates have been added for the following:
- fan_mode
- hold
- mode
- swing_mode
- temperature
- temperature high/low

This doesn't add templates for aux, away mode, power since these already accept custom payload_on/off (although they all share the same payload). It should be straightforward to add templates for them as well if needed.
2021-01-26 16:12:33 +01:00
Erik Montnemery d60fc0de38
Add availability_mode "all" and "any" to MQTT entities (#44987)
* Add availability_mode "all" to MQTT entities

* Add availability mode any
2021-01-11 16:04:22 +01:00
Erik Montnemery 4b3ad0a1cd
Support multiple MQTT availability topics (#37418)
* Support multiple MQTT availability topics

* Make availability list and availability_topic exclusive

* Make availability list and availability_topic exclusive

* Add missing abbreviation
2020-07-04 17:48:34 +02:00
Pieter Goetschalckx 02a36a9b68
Add min_mireds and max_mireds to MQTT Light (#32613)
* Add min_mireds and max_mireds to MQTT Light

* Add abbreviations for min_mireds and max_mireds

* Add tests for min_mireds and max_mireds
2020-05-10 09:34:48 +02:00
unixko 8c84e47c94
added abbreviation for temperature_unit (#35076)
Added temp_unit for temperature_unit.
2020-05-02 19:59:23 +02:00
Jevgeni Kiski a1aebe904e
Add MQTT Alarm Control Panel custom bypass state (#32541)
* MQTT Alarm Control Panel to have all available states

* MQTT Alarm Control Panel to have all available states

* test_arm_custom_bypass_* tests added

* MQTT payload_arm_custom_bypass abbreviation
2020-04-06 11:45:37 +02:00
Erik Montnemery 60ae85564e
Add support for MQTT device triggers (#31679)
* Add support for MQTT device triggers

* Fix test, tweaks

* Improve test coverage

* Address review comments, improve tests

* Tidy up exception handling

* Fix abbreviations

* Rewrite to handle update of attached triggers

* Update abbreviation test

* Refactor according to review comments

* Refactor according to review comments

* Improve trigger removal

* Further refactoring
2020-02-18 13:51:10 -08:00
Rick 3718b25bd9
Add opening and closing states to MQTT covers (#31259)
* Added support for the opening and closing states to MQTT covers

* Processed PR feedback on MQTT cover changes

* Add missing MQTT abbreviation to fix failing tests

* Fixed typo in MQTT abbreviations

* Added mqtt set cover position optimistic test
2020-01-30 21:14:46 +01:00
Iulius 1c2618d99a Add separate command and state topics for mqtt lock (#29808)
* Update lock.py

Allow different command and state topic + different command and state values.

* Formatting updated after black run

* TC updated to reflect different state & cmd values

* Abbreviations for lock states added

* additional non-default state test

* whitespaces fixed

* black formatting run
2019-12-31 15:24:09 +01:00
Raman Gupta 4cb984842a Support custom source type for MQTT device tracker (#27838)
* support custom source type for MQTT device tracker

* fix typo

* add abbreviation
2019-10-22 22:26:29 -07:00
Raman Gupta 4e25807b7d Add ability for MQTT device tracker to map non-default topic payloads to zones/states (#27143)
* add ability for MQTT device tracker to map nondefault topic payloads to zones

* update new parameter name and add abbreviation

* support for payload_home, payload_not_home, and payload_custom

* use constants STATE_NOT_HOME and STATE_HOME as defaults

* reference state constants directly

* add empty dict as default for payload_custom

* change parameter name for custom mapping of payloads to non-home zones to be more descriptive

* removed 'payload_other_zones' per ballobs review

* remove abbreviation for 'payload_other_zones'

* add tests for feature
2019-10-17 17:51:27 -07:00
Erik Montnemery e0be4efe3e Add test case to identify missing MQTT configuration abbreviations (#25616)
* Add missing abbreviations

* Move abbreviations to own file, add script to find missing abbreviations

* Move check from script to test case

* Lint

* Rewrite to use pathlib

* Lint
2019-08-06 17:32:15 -07:00