IHC MQTT Gateway
As an example to the IHC SDK for .NET I have made a IHC to MQTT gateway. It is actually some old code I made long time ago to interface to a specific home automation system (I think it was domoticz). I have now made it mode general so you can configure the MQTT topics for each IHC resource.
Many home automation system have support for MQTT today, so the MQTT gateway will allow you to connect IHC to these systems. The gateway will also be able to run on a raspberry pi with mono.
If you do not already have a MQTT broker running, look at “mosquitto” it is also available for raspberry pi.
You can download the code for the example from github here:
If you do not want to compile the program yourself, you can download download it here:
The configuration of the gateway is located in the ihcmqttgateway.conf file. It is a simple text file you can edit in notepad or whatever you like. There are comments in the file explaining what to do. You can define a mqtt topic to map the a IHC resource id and you can have separate topics for in and out.
By default the programs will look for the ihcmqttgateway.conf file but you can also specify a path to the configuration file as an argument to the program. Syntax:
IhcMqttGateway.exe [-v] pathtoconffile
The -v option will log changes from both IHC and MQTT to the output.
This program is not tested in “production” – I have never used it myself to anything but playing around. There are know limitations like if you send data to an ihc resoruce and the type does not match. Maybe I will improve on it later, or you can do it yourself – you have to code on githut (Just remember to share if you do so)
IHC Resources ids
You can find ihc resource ids by looking in the IHC project file – it is a XML file.
An easier way is to use my IHC Alternative Service View application
In this application you can see a tree view of you your installation, expand and click the resource and get the id.
See the license page