Sending control data to nodes

Hi

I am building myself an Opentherm to emonCMS gateway  to monitor and control the communication between my Intergas boiler and Remaha central heating controller.  It is now working nicely and I am able to monitor the communication and pass the data up to emonCMS over RF69 radio.

The next step is to pass control information back again to tell the gateway to override the controller and set its own heating strategy.  I am able to successfully pass data from a minicom terminal to the device using the format

<nn>,<nn>,<nodeid>s

Now I would like to do the same thing from the emonCMS api as described at https://openenergymonitor.org/emon/modules/emonpi#control

On using the api to send packets they are sent in the format

<nodeid>,<nn>,<nn>,s

which is not recognised by my receiver.

Is this a bug or am I doing something wrong?

In the long term I would prefer to send control packets directly via MQTT.  Is there a way to do this?

****Update****

I have worked out how to send MQTT messages directly to emonhub using nodeRED, but they still go out to the radio in the wrong format.

Thanks

Derek

derek_j's picture

Re: Sending control data to nodes

I have hacked EmonHubJeeInterfacer.py  to change the format of the command sent to the radio, and now it works OK and I can receive commands to my node.

 

Python is not my forte, but here is the change made to the function send()

 

        payload = ""
        for value in range(1, len(data)):
            if int(data[value]) < 0 or int(data[value]) > 255:
                self._log.warning(self.name + " discarding Tx packet: values out of scope" )
                return
            payload += str(int(data[value]))+","
                
        payload += data[0] + cmd

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.