Having a very quick look this morning and fixed a few typos I made in updating my config.yaml.
Result is that binary_sensors are the remaining problem which does gel with the one remaining error I have in my logs.
Invalid config for [binary_sensor.modbus]: expected int for dictionary value @ data['coils'][22]['coil']. Got None. (See /config/configuration.yaml, line 1268). Please check the docs at https://home-assistant.io/components/binary_sensor.modbus/
This is a snippet of what I have for my binary_sensor configuration…
#Start Binary Sensors
#########################################
#
binary_sensor:
#
#Modbus binary sensors
# NOTE: this is line 1268 referenced in the error message
- platform: modbus
coils:
#
#START hub5 binary sensors
#
- name: HW Tariff
hub: hub5
slave: 5
coil: 1538
- name: Front Occupied
hub: hub5
slave: 5
coil: 1544
#END Modbus hub1 binary sensors
#After all the modbus sensors I have the MQTT ones
#START MQTT binary sensors
#
- platform: mqtt
name: "Pool Low Level"
state_topic: "stat/sonoff23/POWER"
# command_topic: "cmnd/sonoff23/POWER"
availability_topic: "tele/sonoff23/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
To be honest I see no difference to the documentation example given for modbus binary sensors
For comparison sake, this is what I have for modbus sensors in my config…again all sensors are normal as are switches.
#########################################
#
#
#START Modbus sensors
#
#
- platform: modbus
scan_interval: 10
registers:
#########################################
#START Modbus hub5 sensors
#
- name: RTC YEAR
hub: hub5
slave: 5
register: 3328
- name: RTC MONTH
hub: hub5
slave: 5
register: 3329
Can anyone advise a solution?
PS: My MQTT binary sensors are all unaffected it seems?
UPDATE: I had a look at the code in binary_sensor.py and I am wondering if (after reading the error message) it may be a matter of how the config items are ordered?
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_COILS): [{
vol.Required(CONF_COIL): cv.positive_int,
vol.Required(CONF_NAME): cv.string,
vol.Optional(CONF_HUB, default=DEFAULT_HUB): cv.string,
vol.Optional(CONF_SLAVE): cv.positive_int,
}]
})
Maybe the config needs to be ordered in the same order as the platform schema above IE:
binary_sensor:
- platform: modbus
scan_interval: 10
coils:
- coil: 100
name: Sensor1
hub: hub1
slave: 1
I’m off to try it anyway!
FURTHER UPDATE: My theory failed…modbus binary sensors appear to need some work it seems.