The Berto IOT Gateway driver provides integration with a variety of IoT devices running the Tasmota firmware such as the Sonoff range of hardware, Shelly IOT devices, Sonoff DIY range, TP-Link Smart Plug devices, Lifx Lights, Yeelight and Flic smart buttons and Zigbee devices using zigbee2mqtt. Drivers are available for relay, sensor, button and light devices which all link via the gateway driver.
Integration to Google Assistant via the Berto Assist service and to Apple Homekit is also available for a list of devices that you select. Integration with Google Assistant, Home Assistant and Flic buttons requires a Berto Hub which can be installed on your own hardware or virtual machine instance from the Action tab. The install option requires that the targeted system is running Raspberry Pi OS or Ubuntu 18.04. Alternatively you can purchase a pre-installed Raspberry Pi 4 with POE and case, see the Subscription Plan property in the Berto Cloud driver. The Berto Hub Homebridge interface can be accessed from a browser at http://berto-iot.local:8581, username admin and password admin. You can also SSH into the hub using username "admin" and password "bertoiot".
Zigbee support is provided using either the Sonoff Zigbee Bridge, Zigbee2MQTT or ZWaveJS2MQTT with a suitable USB Router such as the CC2652 for Zigbee or the AeoTec Z-Stick Gen5+ for ZWave. The Zigbee2MQTT web interface can be found at http://berto-iot.local:8080 and the ZWaveJS2MQTT web interface can be found at http://berto-iot.local:8091.
The following devices are currently supported :-
Tested Shelly devices include :-
Tested Sonoff DIY devices include :-
Tested Tasmota Modules include :-
All Lifx light devices should be supported that are compatible with version 2 of the Lifx LAN Protocol.
For each device you need to install a Berto IOT Generic, Berto IOT Light or Berto IOT Dimmer driver which links to the IoT Gateway.
Devices are discovered and controlled using a variety of protocols depending on the device. For Shelly and Tasmota devices the recommended method is to use an MQTT Broker as this method provides instant realtime feedback when the device state is changed external to the Control4 system. An IoT hub can be automatically installed and configured from the Action menu which installs the required software on a Raspberry Pi models 3 and 4. Once the Pi is installed it will automatically reboot. You will then need to enter the IP address in the MQTT Server property, you do not need a Username or Password. The installed MQTT server also provides the necessary software for integration with Apple Homekit and Flic smart buttons. The Homebridge user interface can be accessed on the IoT Hub at http://{IP Address}:8581, username admin and password admin, where you can find the Homekit Pin Code.
Devices can also be controlled directly using HTTP such as the Sonoff DIY range of hardware but also Shelly and Tasmota devices. External device feedback can be received by polling the devices at the frequency defined in Properties. Sonoff DIY devices provide feedback using mDNS broadcasts meaning those devices do not need to be polled. Using HTTP control negates the need for an MQTT broker. By default Tasmota devices do not respond to mDNS discovery broadcast unless option 55 is turned on using the SetOption55 On command on the console.
Devices can also be entered manually using their IP address causing the gateway to attempt to autodetect the type of device to see if it is supported.
The capabilities of discovered devices are read automatically from the device ie. number of relays, inputs, sensors or the type of light, colour, dimmer etc.
When using an MQTT Server you can also specify additional topics in the Custom Topics property which will cause the gateway to accept messages on those topics and update the MESSAGE and TOPIC variables and also fire the CUSTOM_MESSAGE_RECEIVED event. Messages can also be published to the MQTT broker using the PUBLISH_MESSAGE command in programming. You can insert variables from other devices by specifying the device id and variable name in the format ${Id::Name} within the message. Third party drivers can also integrate with the IoT Gateway to use the connected MQTT broker. A sample driver with source code is available showing how simple it is to integrate, email support@berto.co.uk for details.
When starting the discovery process all supported devices and protocols are scanned, in the case of Flic buttons the Berto Hub is put into pairing mode and pressing the Flic button will cause the pairing process to start. Pairing Flic buttons requires that the Flic is not already connected to an existing bluetooth hub, see Flic troubleshooting to factory reset a button.
The gateway also supports the Sonoff RF bridge and the April Brother bluetooth gateway is in development. To add devices that use a bridge to connect to the gateway the RF and bluetooth codes need to be learned. To do this you need to select the bridge device in the Devices property which will show some additional properties and put the gateway into learning mode. In learning mode you should tigger the device so the RF or bluetooth code is transmitted and recorded for selection in the Close and Open state properties. Select the appropriate code for Close and Open, along with a device name, and then Add Device in the Action property to add the device to the Devices list. Buttons should be added with the close code selected only and contact sensors, such as door & window contacts, motion sensors etc. require both the close and open code. Up to 8 pairs of codes can be added to a device covering 4 button key fobs allowing groups of up to 8 contacts or motion sensors to be assigned to a single device. The codes generated by the device are displayed in the LUA window.
Zigbee support is provided by adding a suitable USB router attached to the Berto Hub eg. CC2652 Router and also the Sonoff Zigbee Bridge. Zigbee devices can be paired to the appropriate bridge by selecting the bridge and using the Pair action in properties. Once devices are paired to the bridge a new discovery must be run to find the newly paired zigbee devices.
Support form all the core devices is builtin to each service that the IoT Gateway provides. Additionally custom plugin modules are downloaded for models not builtin if they exist allowing for easy addition of new devices without the need to update the IoT Gateway driver itself. Currently plugin support is provided for the Tasmota Zigbee service only.
Custom topic messages can be sent to an HTTP RestFUL endpoint which can parse the payload and return name/value pairs which are used to update variables on the IoT Gateway. The Berto Hub install creates a REST server on port 3000 with an iot.js script that can be modified to suit the users individual needs. The endpoint is accessed at http://{Hub IP Address}:3000/iot.js.
Properties
- Devices - List of available IoT devices found on the network.
- Address - IP Address of device. This is the address found or address of a device you wish to attempt to autodetect.
- Description - Device description.
- Sleepy - Defines whether the device is always on or only wakes when triggered eg. battery powered devices. These devices are excluded from polling.
- Name - Name of device to be added. (RF & Bluetooth learning mode only).
- Close Code - The code transmitted code that triggers the close state for the device. (RF & Bluetooth learning mode only).
- Open Code - The code transmitted code that triggers the open state for the device. (RF & Bluetooth learning mode only).
- Action - Option to manually refresh the state of the device, add or remove the device from the Devices list or pair devices when a Zigbee Bridge is selected.
- Polling Frequency - The frequency in seconds for which devices that do not support realtime feedback will be polled, a value of 0 disables polling.
- Use mDNS Discovery - Enable mDNS device discovery and realtime feedback for devices that support it such as Sonoff DIY.
- MQTT Server - The MQTT Broker to connect to in the form mqtt:// or mqtts:// followed by the hostname:[port]. The port number is optional and defaults to 1883 for mqtt connections and port 8883 for mqtts SSL connections. If you have a Berto Hub you should enter it's IP address here in the format mqtt://{ip address}.
- Username - Broker username.
- Password - Broker password.
- Quality Of Service - MQTT QoS value used for subscriptions.
- Custom Topics - Additional MQTT topics that will be subscribed to, multiple topics can be separated with commas.
- Custom Topics Endpoint - RestFUL API endpoint that MQTT messages received on a custom topic are sent to. The format of the endping should be in the form http:// or https://.
- Tasmota Full Topic - This os the Full Topic as defined on all your Tasmota devices. eg. tasmota/%prefix%/%topic%/
- Tasmota Group Topic - This is the Group Topic used by all your Tasmota devices. The Group Topic can be set from the console using cmnd/{name}/GroupTopic {group}. eg. cmnd/ledlamp/GroupTopic tasmotas
- Zigbee Server - The Zigbee server type to use, can be either Zigbee2MQTT, ZWaveJS2MQTT or Disabled.
- Zigbee Topic - The topic used by the selected Zigbee server.
- Exposed Devices - The devices that you want to expose to the enabled external integration services for control and querying.
- Add Room Watch Devices - Automatically add all available watch devices for each room.
- Add Room List Devices - Automatically add all available watch devices for each room.
- Google Assistant Token - The system generated token created when linking the driver Google Assistant.
- Amazon Alexa Token - The system generated token created when linking the driver Amazon Alexa. (WORK IN PROGRESS).
- Homekit Pin Code - The pin code used to identify the Berto Hub as a Homekit accessory which is automatically created by the Berto Hub.
- Home Assistant Discovery Topic - Discovery prefix topic setup in Home Assistant.
- Status - Gateway status updates.
Actions
- Start Discovery - Attempt to discovery all compatible devices on your local network and MQTT broker server. Discovery will run for 60m seconds unless stopped manually. Some devices, such as battery operated devices, may need to be activated or powered off and back on to issue a device announcement.
- Stop Discovery - Stop device discovery
- Push Devices - Push available devices to slave IoT drivers.
- Report Unrecognised Devices - Email a report of unrecognised devices to Berto Support.
- List Device Mappings - List devices assigned to driver mappings.
- Clear Devices - Clears available devices list.
- Export Devices - Exports the configuration and devices found to a JSON formatted file at http://{Controller Address}/imagetmp/config.json.
- Import Devices - Imports the configuration and devices from a JSON formatted file at http://{Controller Address}/imagetmp/config.json.
- Restart Services - Restart all integration services (MQTT, mDNS, Lifx and Polling timer) and publish Exposed Devices configuration.
- List Plugins - List installed plugins.
- Refresh Plugins - Refresh all plugins. Clear and download latest version of all plugins in use.
- Install IoT Hub - Install the required software on a Raspberry Pi model 3 or 4 or Debian/Ubuntu distribution. You will need to enter the IP Address, username and password of the Raspberry Pi. The user will need to have the required the permissions to sudo to the root user. The default Raspberry Pi user is "pi" and the password is "raspberry". Installation progress can be seen in the LUA output window. The Homebridge interface can be accessed from a browser at http://{IP Address}:8581, username admin and password admin.
- Uninstall IoT Hub - Uninstall the software from the IoT Hub.
- Integration Menu - Link to Berto Assist and Publish Exposed Device configuration to Berto Assist, Home Assistant and Apple Homekit.
Release Notes
v1.00 - 2020-03-15
v1.10 - 2020-03-29
- Auto Update changed to be managed via the Auto Update Time specified in the Berto Cloud driver.
v1.11 - 2020-04-17
- Added Console option to Debug Mode property to allow for external logging output.
v1.12 - 2020-06-05
- Added mDNS support and native support for Sonoff DIY devices.
- Added support for HTTP control of Shelly and Tasmota devices.
- Removed need to enable features as driver will disable any protocols that are not used by any devices discovered.
v1.13 - 2020-06-11
- Added Home Assistant support.
v1.14 - 2020-06-12
- Fixed issue with polling timer not working on some devices.
v1.15 - 2020-06-15
- Fixed issue with Berto Hub install script no installing screen command.
v1.16 - 2020-06-17
- Fixed issue with feedback on Homekit devices.
- Added support for Google Assistant only enabled if Berto Assist Token registered.
- Added support for Homekit only enabled if Homekit Pin Code registered entered.
- Added support for Home Assistant only enabled if Home Assistant Discovery Topic entered.
v1.17 - 2020-06-23
- Added external integration support for light drivers outlet_dimmer, outlet_dimmer_module, outlet_switch_module, outlet_wireless and outlet_wireless_dimmer.
v1.18 - 2020-06-30
- Added Google Assistant support for additional device types - Curtains, Blinds, Windows, Doors, Locks, Gates, Garages, Fans, Heaters, Water Heaters, Switches and Fireplaces. The Berto Assist service has be certified by Google.
- Add Secure Devices property to select those devices that require Google Two factor authentication using a pin code defined in the Assist Pin Code property.
- Fixed issue with Homekit Pin Code property not get populated on Hub reset.
v1.19 - 2020-07-13
- Fixed issue with Homekit not changing state on some light devices.
- Added lock.c4i proxy support.
v1.20 - 2020-09-07
- Fixed issue with export and import losing device mappings when do a new discovery.
- Added Restart Services to Actions tab and programming.
- Added Homebridge service to IoT Hub Installation.
- Added MQTT Publish Message command to programming.
v1.21 - 2020-09-18
- Fixed issue with variables in published messages in an invalid formatting causing a director lock up.
v1.22 - 2020-09-22
v1.23 - 2020-10-31
- Fixed issue with Tasmota Dimmers not being discovered as Dimmers.
- Added support for the Sonoff Zigbee Bridge.
- Added support for TP-Link Smart Plug devices. Tested with KP105, KP303 and HS103.
- Added IP address discovery for Lifx devices.
v1.24 - 2021-01-31
- Increased Discovery timer to 5 minutes.
- Added support for downloadable plugins providing easy addition for new device support.
- Added option to Actions tab to delete installed plugins.
- Added initial TP-Link & Yeelight support.
- Added Custom Topics Endpoint to allow enduser processing of custom MQTT messages received.
v1.25 - 2021-03-31
- Added support Tuya TS0041, TS0042, TS0043 and TS0044 zibgee wireless buttons. See Supported Plugins.
v1.26 - 2021-08-06
- Added MQTT_KEEPALIVE_MISSED event to detect when disconnection occurs from the MQTT Broker and restart services from programming if required.
v1.27 - 2021-08-13
- Added support for third party drivers to access the IoT Gateway to send and receive MQTT messages for their own driver development.
v1.28 - 2021-08-29
- Fixed issue with custom message payloads not appearing correcting when set to a number.
v1.29 - 2021-09-04
- Fixed issue with discovery not recognising Flic V2 buttons.
- Added support for ZWaveJS2MQTT.
v1.30 - 2021-11-20
- Fixed issue variable assignments on NUMBER and STRING type variables.
- Fixed issue with manual discovery not finding some Shelly and Sonoff devices.
- Added support for Shelly devices using HTTP protocol to provide state feedback using Action URLs.
- Fixed issue with Report Device email attachments being corrupted.
Licence
DM