Skip to content

Commit

Permalink
Merge branch 'dev' into Dev_Name_in_DB
Browse files Browse the repository at this point in the history
  • Loading branch information
krkeegan committed Dec 13, 2020
2 parents 8577a02 + 256ebbd commit f0f5df8
Show file tree
Hide file tree
Showing 61 changed files with 3,605 additions and 851 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.7.2
current_version = 0.7.3
commit = True
tag = False

Expand Down
57 changes: 56 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,65 @@
# Revision Change History

## [0.7.4]

### Additions

- Major improvements to the IOLinc support. In short all functions of the
device should now be supported. Including momentary modes in which the
relay opens for a defined period of time before closing again. Specific
topics have been added for the relay and the sensor so they can both be
tracked individually. ([PR 197][P197]) BREAKING CHANGE - the scene_topic
has been elimited, please see the notes below for replacement functionality.
Please see notes in:
- [config.yaml](https://github.com/TD22057/insteon-mqtt/blob/master/config.yaml) -
specifically the IOLinc sections in both the device and mqtt sections
- [MQTT Doc](https://github.com/TD22057/insteon-mqtt/blob/master/docs/mqtt.md) -
note the new set_flags options for IOLinc and the IOLinc section

- A new queueing system for battery devices ([PR240][P240]):
- Messages sent to the device will be queued until the device is awake
- When the device sends a message, the modem will attempt to immediately
send the oldest outgoing message. This only works for some devices.
- Added an 'awake' command, to identify when a battery device has been
manually awaken via holding the set button. This will cause all queued
and future messages to be sent to the device for up to three minutes

- Added support for Smartenit EZIO4O 4 relay output module (thanks @embak)
([PR 219][P219])

### Fixes

- Database delta is updated on database writes. This eliminates a number of
unnecessary refresh requirements, particularly around pairing.
([PR 248][P248])

## [0.7.3]

Fixing a number of small bugs in preparation for upcoming releases which
will add new features.

### Additions

- Added MQTT broker ID optional config input to allow the user to input the
MQTT broker ID the client will use (thanks @kpfleming) ([PR #220][P220])

### Fixes

- Increase timeout for DB Refresh and allow retry for initial request.
([PR #237][P237])

- Detect disconnections during poll() calls (thanks @kpfleming) ([PR 227][P227])

- Modem Responder Group from Thermostat Should be 0x01 ([PR #198][P198])
([Issue 154][I154])

- Fixed device db find command to check the local group so multiple responsders
can be created. ([Issue #181][I181])

- Fixed a bug in the modem database class when removing an entry (thanks
@krkeegan) ([PR#196][P196])

- Changed the MQTT remote to never mark messages for retain so the broker
- Changed the MQTT Remote to never mark messages for retain so the broker
doesn't get out of sync with the device. ([Issue #I210][I210])


Expand Down Expand Up @@ -383,3 +430,11 @@
[P196]: https://github.com/TD22057/insteon-mqtt/pull/196
[I210]: https://github.com/TD22057/insteon-mqtt/issues/210
[P220]: https://github.com/TD22057/insteon-mqtt/pull/220
[I181]: https://github.com/TD22057/insteon-mqtt/issues/181
[I154]: https://github.com/TD22057/insteon-mqtt/issues/154
[P227]: https://github.com/TD22057/insteon-mqtt/pull/227
[P237]: https://github.com/TD22057/insteon-mqtt/pull/227
[P197]: https://github.com/TD22057/insteon-mqtt/pull/197
[P240]: https://github.com/TD22057/insteon-mqtt/pull/240
[P248]: https://github.com/TD22057/insteon-mqtt/pull/248
[P219]: https://github.com/TD22057/insteon-mqtt/pull/219
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ My initial intent with this package is better integrate Insteon into
Home Assistant and make it easier and more understandable to add new
features and devices.

Version: 0.7.2 ([History](HISTORY.md))
Version: 0.7.3 ([History](HISTORY.md))

### Breaking changes from last version:

Expand Down
187 changes: 134 additions & 53 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ insteon:
thermostat:
# - aa.bb.cc: 'downstairs'

# EZIO4O 4 output relay modules
#ezio4o:
# - aa.bb.cc: 'relays'

#==========================================================================
#
# MQTT configuration
Expand Down Expand Up @@ -377,6 +381,17 @@ mqtt:
low_battery_topic: 'insteon/{{address}}/battery'
low_battery_payload: '{{is_low_str.upper()}}'

# Output heartbeat topic and payload. This message is sent
# every 24 hours. Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# is_heartbeat = 0/1
# heartbeat_time = UNIX time float of the last heartbeat
# Not every battery device currently sends this data. Currently only
# the leak sensor is known to provide this data
heartbeat_topic: 'insteon/{{address}}/heartbeat'
heartbeat_payload: '{{heartbeat_time}}'

#------------------------------------------------------------------------
# Motion sensors
#------------------------------------------------------------------------
Expand Down Expand Up @@ -409,6 +424,9 @@ mqtt:
# Leak sensors
#------------------------------------------------------------------------

# Leak sensors will use the heartbeat configuration
# inputs from battery_sensor.
#
# Leak sensors will report the dry/wet status and a heartbeat every 24
# hours. The leak sensors does not support low battery signal like other
# battery operated devices.
Expand Down Expand Up @@ -437,14 +455,38 @@ mqtt:
wet_dry_topic: 'insteon/{{address}}/wet'
wet_dry_payload: '{{is_wet_str.upper()}}'

# Output heartbeat topic and payload. This message is sent
# every 24 hours. Available variables for templating are:
#------------------------------------------------------------------------
# Mini remotes
#------------------------------------------------------------------------

# Battery powered remotes (usually 4 or 8 buttons). A message is
# sent whenever one of the buttons is pressed.
#
# The Remote will use the low_battery configuration
# inputs from battery_sensor.
remote:
# Output state change topic and template. This message is sent
# whenever a button is pressed. Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# is_heartbeat = 0/1
# heartbeat_time = UNIX time float of the last heartbeat
heartbeat_topic: 'insteon/{{address}}/heartbeat'
heartbeat_payload: '{{heartbeat_time}}'
# button = 1...n (button number 1-8 depending on configuration)
# on = 0/1
# on_str = 'off'/'on'
# mode = 'normal'/'fast'/'instant'
# fast = 0/1
# instant = 0/1
state_topic: 'insteon/{{address}}/state/{{button}}'
state_payload: '{{on_str.upper()}}'

# Manual mode (holding down a button) is triggered once when the button
# is held and once when it's released. Available variables for
# templating are address (see above), name (see above), button (see
# above), and:
# manual_str = 'up'/'off'/'down'
# manual = 1/0/-1
# manual_openhab = 2/1/0
#manual_state_topic: 'insteon/{{address}}/manual_state'
#manual_state_payload: '{{manual_str.upper()}}'

#------------------------------------------------------------------------
# Smoke Bridge
Expand Down Expand Up @@ -584,36 +626,6 @@ mqtt:
cool_sp_command_topic: 'insteon/{{address}}/cool_sp_command'
cool_sp_payload: '{ "temp_f" : {{value}} }'

#------------------------------------------------------------------------
# Mini remotes
#------------------------------------------------------------------------

# Battery powered remotes (usually 4 or 8 buttons). A message is
# sent whenever one of the buttons is pressed.
remote:
# Output state change topic and template. This message is sent
# whenever a button is pressed. Available variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# button = 1...n (button number 1-8 depending on configuration)
# on = 0/1
# on_str = 'off'/'on'
# mode = 'normal'/'fast'/'instant'
# fast = 0/1
# instant = 0/1
state_topic: 'insteon/{{address}}/state/{{button}}'
state_payload: '{{on_str.upper()}}'

# Manual mode (holding down a button) is triggered once when the button
# is held and once when it's released. Available variables for
# templating are address (see above), name (see above), button (see
# above), and:
# manual_str = 'up'/'off'/'down'
# manual = 1/0/-1
# manual_openhab = 2/1/0
#manual_state_topic: 'insteon/{{address}}/manual_state'
#manual_state_payload: '{{manual_str.upper()}}'

#------------------------------------------------------------------------
# Fan Linc
#------------------------------------------------------------------------
Expand Down Expand Up @@ -828,10 +840,13 @@ mqtt:
# then the on and off commands work like a normal switch. The set-flags
# command line command can be used to change the settings.
#
# NOTE: the on/off payload forces the relay to on or off so it's most
# likely NOT the way you want to use this. The scene payload is the same
# trigger the IOLinc as a responder which respects the sensors settings in
# momentary-C mode and is most likely the way you do want to use this.
# NOTE: the on/off payload forces the relay to on or off ignoring any special
# requirements associated with the Momentary_A,B,C functions or the
# relay_linked flag. It can be used without issue for latching setups, but
# if you want to use this accurately for Momentary_A,B,C setups, you may need
# to have some logic upstream from this command to check the state of sensor
# and or the command to determine if setting the relay on or off is
# appropriate .
#
# In Home Assistant use MQTT switch with a configuration like:
# switch:
Expand All @@ -840,17 +855,39 @@ mqtt:
# command_topic: 'insteon/aa.bb.cc/scene'
io_linc:
# Output state change topic and template. This message is sent whenever
# the device sensor state changes. Available variables for templating
# are:
# the device sensor or device relay state changes. Available variables for
# templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# on = 0/1
# on_str = 'off'/'on'
# sensor_on = 0/1
# relay_on = 0/1
# sensor_on_str = 'off'/'on'
# relay_on_str = 'off'/'on'
state_topic: 'insteon/{{address}}/state'
state_payload: '{{on_str.upper()}}'
state_payload: '{ "sensor" : "{{sensor_on_str.lower()}}", "relay" : {{relay_on_str.lower()}} }'

# Output relay state change topic and template. This message is sent
# whenever the device relay state changes. Available variables for
# templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# relay_on = 0/1
# relay_on_str = 'off'/'on'
relay_state_topic: 'insteon/{{address}}/relay'
relay_state_payload: '{{relay_on_str.lower()}}'

# Output sensor state change topic and template. This message is sent
# whenever the device sensor state changes. Available variables for
# templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# sensor_on = 0/1
# sensor_on = 'off'/'on'
sensor_state_topic: 'insteon/{{address}}/sensor'
sensor_state_payload: '{{sensor_on_str.lower()}}'

# Input on/off command. This forces the relay on/off and ignores the
# momentary-C sensor setting. Use this to force the relay to respond.
# momentary-A,B,C setting. Use this to force the relay to respond.
# If momentary mode is active, it will turn off after the delay. The
# output of passing the payload through the template must match the
# following:
Expand All @@ -862,13 +899,6 @@ mqtt:
on_off_topic: 'insteon/{{address}}/set'
on_off_payload: '{ "cmd" : "{{value.lower()}}" }'

# Scene on/off command. This triggers the IOLinc as if it were a
# responder to a scene command and is the "correct" way to trigger the
# IOLinc relay in that it respects the momentary settings. The inputs
# are the same as those for the on_off topic and payload.
scene_topic: 'insteon/{{address}}/scene'
scene_payload: '{ "cmd" : "{{value.lower()}}" }'

#------------------------------------------------------------------------
# On/off outlets
#------------------------------------------------------------------------
Expand Down Expand Up @@ -921,4 +951,55 @@ mqtt:
scene_topic: 'insteon/{{address}}/scene/{{button}}'
scene_payload: '{ "cmd" : "{{value.lower()}}" }'

#------------------------------------------------------------------------
# EZIO4O 4 relay output module
#------------------------------------------------------------------------
# EZIO4O is a 4 relay output wall plug module from Smartenit.
# Each relay has a normally open and a normally closed contact.
# Device relay 1 to 4 correspond to topics button 1 to 4.
# In Home Assistant use MQTT switch with a configuration like:
# switch:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/state/1'
# command_topic: 'insteon/aa.bb.cc/set/1'
# switch:
# - platform: mqtt
# state_topic: 'insteon/aa.bb.cc/state/2'
# command_topic: 'insteon/aa.bb.cc/set/2'
ezio4o:
# Output state change topic and template. This message is sent
# whenever the device state changes for any reason. Available
# variables for templating are:
# address = 'aa.bb.cc'
# name = 'device name'
# button = 1 to 4 (relay number)
# on = 0/1
# on_str = 'off'/'on'
# mode = 'normal'/'fast'/'instant'
# fast = 0/1
# instant = 0/1
# reason = 'device'/'scene'/'command'/'refresh'/'...'
state_topic: "insteon/{{address}}/state/{{button}}"
state_payload: "{{on_str.upper()}}"

# Input on/off command. Similar functionality to the cmd_topic but only
# for turning the device on and off. If reason is input, is will be
# passed through to the state_payload. The output of passing the payload
# through the template must match the following:
# { "cmd" : 'on'/'off', "button": button,
# ["mode" : 'normal'/'fast'/'instant'],
# ["fast" : 1/0], ["instant" : 1/0], ["reason" : "..."] }
# Available variables for templating are:
# value = the input payload
# json = the input payload converted to json. Use json.VAR to extract
# a variable from a json payload.
on_off_topic: "insteon/{{address}}/set/{{button}}"
on_off_payload: '{ "cmd" : "{{value.lower()}}" }'

# Scene on/off command. This triggers the scene broadcast on the outlet
# in the same way clicking the button would. The inputs are the same as
# those for the on_off topic and payload.
scene_topic: "insteon/{{address}}/scene/{{button}}"
scene_payload: '{ "cmd" : "{{value.lower()}}" }'

#----------------------------------------------------------------
Loading

0 comments on commit f0f5df8

Please sign in to comment.