New binding suggestion: Wavin AHC 9000 / Jablotron AC-116

@hpetersen: What address did you use when using my python script?

@zmartify: I managed to update the binding, and got a lot of error messages about the serial port not working, until I added it to /etc/default/openhab2:

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/tty-efergy:/dev/tty-uzb:/dev/tty-wavin-modbus"

(I have a symlink /dev/tty-wavin-modbus updated by udev, to point to the USB serial adapter, currently /dev/ttyUSB0).

Got all my thermostats online again, so now I can get on with testing. Thank you :wink:

@zmartify: I now get the room temperatures (again).
Here is a snippet from the log

2018-09-28 16:27:37.643 [INFO ] [rtmodbus.handler.ModbusSerialHandler] - Initializing Zmartify ModbusFunction Serial Controller.
2018-09-28 16:27:37.731 [INFO ] [artmodbus.handler.ZmartModbusHandler] - Initialising Network Zmartify ModbusFunction controller zmartmodbus:serialbridge:407cef13
2018-09-28 16:27:37.763 [INFO ] [us.internal.factory.ModbusActionFeed] - LaunchPublisher
2018-09-28 16:27:37.964 [INFO ] [artmodbus.handler.ZmartModbusHandler] - ModbusControllerHandler.handlecommand: AirTemperature REFRESH
2018-09-28 16:27:37.968 [INFO ] [artmodbus.handler.ZmartModbusHandler] - ModbusControllerHandler.handlecommand: AirTemperature REFRESH
...
2018-09-28 16:27:38.267 [INFO ] [internal.controller.ModbusController] - Starting ModbusFunction controller 0
2018-09-28 16:27:38.283 [INFO ] [tmodbus.internal.protocol.ModbusNode] - NODE 0: Creating a new modbus node
...
2018-09-28 16:27:39.156 [INFO ] [artmodbus.handler.ModbusThingHandler] - NODE 3: Controller status changed to ONLINE.
2018-09-28 16:27:39.158 [INFO ] [artmodbus.handler.ModbusThingHandler] - NODE 5: Controller status changed to ONLINE.
2018-09-28 16:27:39.155 [INFO ] [artmodbus.handler.ModbusThingHandler] - NODE 4: Controller status changed to ONLINE.
2018-09-28 16:27:39.187 [INFO ] [artmodbus.handler.ModbusThingHandler] - NODE 6: Controller status changed to ONLINE.
2018-09-28 16:27:39.188 [INFO ] [artmodbus.handler.ModbusThingHandler] - NODE 7: Controller status changed to ONLINE.
...
2018-09-28 16:27:39.966 [INFO ] [tmodbus.internal.protocol.ModbusNode] - NODE 21: Creating a new modbus node
2018-09-28 16:27:39.980 [ERROR] [odbus.internal.factory.ModbusFactory] - NODE 21: DataSet 21:null not found
...
2018-09-28 16:27:40.008 [INFO ] [tmodbus.internal.protocol.ModbusNode] - NODE 22: Creating a new modbus node
2018-09-28 16:27:40.034 [ERROR] [odbus.internal.factory.ModbusFactory] - NODE 22: DataSet 22:null not found
...
2018-09-28 16:28:09.881 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 402 minimumLength=5 respIndex=0
2018-09-28 16:28:47.958 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 406 minimumLength=5 respIndex=0
2018-09-28 16:29:10.636 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 401 minimumLength=5 respIndex=0
2018-09-28 16:30:03.670 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 403 minimumLength=5 respIndex=0
2018-09-28 16:30:15.089 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 401 minimumLength=5 respIndex=0
2018-09-28 16:30:19.872 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 401 minimumLength=5 respIndex=0
2018-09-28 16:30:42.651 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 401 minimumLength=5 respIndex=0
2018-09-28 16:31:16.844 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 402 minimumLength=5 respIndex=0
2018-09-28 16:31:25.440 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 401 minimumLength=5 respIndex=0
2018-09-28 16:31:33.871 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 401 minimumLength=5 respIndex=0
2018-09-28 16:32:22.630 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 401 minimumLength=5 respIndex=0

@zmartify: Is there something I can do about these Recv timeout messages?

Now, on to the good news:
I have a ā€œSetpointā€ item in my sitemap, and changing the temperature, I see this in the log:

2018-09-28 16:57:51.297 [INFO ] [artmodbus.handler.ZmartModbusHandler] - ModbusControllerHandler.handlecommand: ManualTemp 21.0

ā€¦ and the setpoint on the thermostat changes. Likewise, if the setpoint is changed on the thermostat, the change is reflected in openhab as well. Very nice :wink:

I did initially have some problems getting this working. Not really sure why, but after restarting openHAB, it seems to be working now.

Thank you, @zmartify.

Best regards,
Mikkel

Hi guys,

Okay, so far so goodā€¦
I got the binding working. Or sort of :slight_smile:
I deletede all of the manual config files and set it up throu paperUI as you suggested @spiff42. Thank you.

I can now see everything is online, all my room thermosats is listed and in the log i see lots of communication with the Wavin AHC9000.

2018-09-28 20:50:11.553 [DEBUG] [rtmodbus.handler.ModbusSerialHandler] - MODBUS receive: 01430800F700000000000011CC

2018-09-28 20:50:11.553 [DEBUG] [odbus.internal.factory.ModbusFactory] - dataSetId: 88

2018-09-28 20:50:11.807 [DEBUG] [rtmodbus.handler.ModbusSerialHandler] - MODBUS receive:         0143064D5C000300028B54

2018-09-28 20:50:11.807 [DEBUG] [odbus.internal.factory.ModbusFactory] - dataSetId: 89

2018-09-28 20:50:12.419 [WARN ] [rtmodbus.handler.ModbusSerialHandler] - Recv timeout : 404     minimumLength=5 respIndex=0

2018-09-28 20:50:12.656 [DEBUG] [rtmodbus.handler.ModbusSerialHandler] - MODBUS receive:     01430400000000F4F3

2018-09-28 20:50:12.657 [DEBUG] [odbus.internal.factory.ModbusFactory] - dataSetId: 8  

The issue now is that it does not show anything? I canā€™t see room temperature or battery level?
Got any clues here guys? cc/ @spiff42 @zmartify

Have you created any ā€œthingsā€?

You can do it by PaperUI, but I prefer a file. /etc/openhab2/items/heating.items:

Number UtilityRoomManualTemp        "Bryggers Setpunkt [%.1f  Ā°C]"          <temperature> { channel="zmartmodbus:jablotrontp150:407cef13:adr1c0e3:ManualTemp" }
Number UtilityRoomAirTemp           "Bryggers luft [%.1f  Ā°C]"              <temperature> (gHeatingAirTemps) { channel="zmartmodbus:jablotrontp150:407cef13:adr1c0e3:AirTemperature" }
Number UtilityRoomFloorTemp         "Bryggers FloorTemp [%.1f  Ā°C]"         <temperature> { channel="zmartmodbus:jablotrontp150:407cef13:adr1c0e3:FloorTemperature" }
Number UtilityRoomComfortTemp       "Bryggers Comfort [%.1f  Ā°C]"           <temperature> { channel="zmartmodbus:jablotrontp150:407cef13:adr1c0e3:ComfortTemp" }
Number UtilityRoomEcoTemp           "Bryggers Eco [%.1f  Ā°C]"               <temperature> { channel="zmartmodbus:jablotrontp150:407cef13:adr1c0e3:EcoTemp" }
Number UtilityRoomHolidayTemp       "Bryggers Holiday [%.1f  Ā°C]"           <temperature> { channel="zmartmodbus:jablotrontp150:407cef13:adr1c0e3:HolidayTemp" }
Number UtilityRoomStandbyTemp       "Bryggers Standby [%.1f  Ā°C]"           <temperature> { channel="zmartmodbus:jablotrontp150:407cef13:adr1c0e3:StandbyTemp" }
Number UtilityRoomPartyTemp         "Bryggers Party [%.1f  Ā°C]"             <temperature> { channel="zmartmodbus:jablotrontp150:407cef13:adr1c0e3:PartyTemp" }
Number UtilityRoomDesiredTemp       "Bryggers Desired [%.1f  Ā°C]"           <temperature> { channel="zmartmodbus:jablotrontp150:407cef13:adr1c0e3:DesiredTemp" }

You can get the information to put into ā€œchannelā€ from PaperUI. Go to Configuration -> Things and select a thermostat (TP-150). There you see all the channels the thing offers.
For example, I have one listed as ā€œSet Temperature - zmartmodbus:jablotrontp150:407cef13:adr1c0e3:ManualTempā€. There is a little icon to the right of the channel. If you click it, the string will be copied to the clipboard, so you can insert it in the .items-file.

Then I have the following in /etc/openhab2/sitemaps/test.sitemap:

sitemap test label="Test" {
    Frame {
        Text label="Varme" icon="temperature" {
            Frame label="Bryggers" {
                Setpoint item=UtilityRoomManualTemp label="Temperatur [%.1f Ā°C]" minValue=15 maxValue=28 step=0.5
                Default item=UtilityRoomAirTemp
            }
        }
    }
}

Try starting with that as a template, then use the classic UI or the app to see if you can read and set the thermostat.

Hi Henrik,

On the serial port ā€™thingā€™ called slave1 you can ā€œenable counters" which will tell you if you have a communication problem. Number of time-outs should less than 1%. Possible issues can be cable length, modbus receiver. You may need to terminate your modbus cable depending on the length.

Iā€™m on holiday for the moment, so will only be online occasionally.

Med venlig hilsen / Best regards,

Peter Kristensen
CEO / Founder

Zmartify ApS, Stavlundvej 8, DK-7540 Haderup
www.zmartify.dk- tel: +45 2046 4587 - email: peter@zmartify.dk

Hi @zmartify.

I got the binding to communicate real quick, but now i encountered a new problem :slight_smile:

2018-10-01 09:49:35.906 [ERROR] [rtmodbus.handler.ModbusSerialHandler] - ***** ZmartModbus test version has expired... contact peter@zmartify.dk ****

Sorry guys,

A new version without this restriction has been uploaded - just replace it and everything should be ok :slight_smile:

Med venlig hilsen / Best regards,

Peter Kristensen
CEO / Founder

Zmartify ApS, Stavlundvej 8, DK-7540 Haderup
www.zmartify.dk- tel: +45 2046 4587 - email: peter@zmartify.dk

Thanks @zmartify,

I have the new version running now. I still get a bunch of Recv timeout in the log, so maybe I should check bus termination etc. I know for sure that I have enabled 120ohm termination at the USB converter end, but there is probably not any termination at the AHC9000 end (cable is cat5 about 2 meters).

Best regards,
Mikkel

Thank you @zmartify.

I got it all setup and working now, i can read the tempereatures from system now.
But when i set the desired temperature from within openhab the TP150 does not set the temperature automatically. I have to push the center button on the thermosat and wait about 2-3 seconds before the desired temperature is changed?
Do you experience the same @spiff42?

So far I have only been using ManualTemp for setting and AirTemperature for reading the current temperature. ManualTemp seems to work ā€œboth waysā€ for me, i.e. changing the ManualTemp item in OpenHAB sitemap seems to change the setpoint on the thermostat (although I can only verify it by pressing the button), and turning the wheel on the thermostat seems to update the ManualTemp item.

I suppose the DesiredTemp should simply reflect one of the other temperatures (ManualTemp, ComfortTemp, EcoTemp, HolidayTemp, StandbyTemp or PartyTemp), based on which mode is selected.

With an old version of the binding I tried to set the mode, but at that time I was unsuccessful (I would like to use party mode and holiday mode, because they shows cute little icons of a cocktail and suitcase on the thermostat).

Maybe the problem you are experiencing is simply that the binding does not find out that desiredTemp changed? As far as I can see, the readings are only updated when the status flags indicate they have changed. This means if I change my sitemap or items definitions, the values are not shown until they change (i.e. AirTemp changes or ManualTemp is changed), or until I restart OpenHAB (which seems to trigger a complete refresh).

But I am not really sure what to use desiredTemp for, at least as long as I have not gotten modes to work.

Best regards,
Mikkel

Hi @spiff42,
Oh sorry i am using manual to set temperature. But i will try with desired when i get home from work.

Regarding the set mode i am useing this in my sitemap

Selection item=badStue_RoomMode label="Mode" mappings=[0="Manual", 1="Permanent standby", 2="Permanent Eco", 3="Permanent Comfort", 4="Party on manual mode", 5="Holiday on manual mode"] 

Itā€™s not confirmed to work tho. But i will test this later today too.

If you inspect the binding you get the following settings for modes.

<!-- Thermostat Mode Channel -->
<channel-type id="thermostat_mode">
	<item-type>Number</item-type>
	<label>Thermostat Mode</label>
	<description>Sets the thermostat mode</description>
	<category>Config</category>
	<state>
		<options>
			<option value="0">Manual</option>
			<option value="1">Permanent standby</option>
			<option value="2">Permanent Eco</option>
			<option value="3">Permanent Comfort</option>
			<option value="4">Party on manual mode</option>
			<option value="5">Holiday on manual mode</option>
			<option value="8">Week schedule</option>
			<option value="9">Temporary standby (do not use)</option>
			<option value="10">Temporary Eco</option>
			<option value="11">Temporary comfort</option>
			<option value="12">Party with week schedule</option>
			<option value="13">Holiday with week schedule</option>
		</options>
	</state>
</channel-type>

Those options are taken directly from the Wavin modbus documentation. As I said, with an OLD version of the binding, I had no success getting this to work (with the newest one I have not tested it yet).

From my reverse-engineering of the Wavin display to controller communication, my understanding is as follows (there are no guarantees, but this is how I believe it works):
Depending on the mode, the thermostat will use different registers as the setpoint:
Mode 0 => ManualTemp
Mode 1 => StandbyTemp
Mode 2 => EcoTemp
Mode 3 => ComfortTemp
Mode 4 => PartyTemp
Mode 5 => HolidayTemp

So for instance if ComfortTemp is 22.0 and mode is 3, the thermostat will use 22.0 as the setpoint (and I think this should be reflected in the DesiredTemp register, but I donā€™t know if the binding updates DesiredTemp item when mode is changed).

For my use with OpenHAB I donā€™t really need the different setpoints, but as I said, setting party-mode or holiday mode also shows a little icon on the thermostat.

The modes 8 and above are used with a schedule programmed into the AHC9000. I donā€™t think that makes much sense when OpenHAB is involved - it just complicates things without adding anything.

I suppose using Eco or Comfort could be possible as well, but again I am not sure what that brings. At least in my house where the floor heating is in the bottom of a 10 cm concrete slab, it takes several hours from turning on the heating until the floor is warm, so until now I have not had much luck adjusting the temperatures during the day/night (schedules). This also means that there is not much point in being able to set the thermostats in each room. The display tells me the current temperature, but I usually only need to adjust it if going on holiday, etc.

/Mikkel

BTW: I donā€™t think you are supposed to change DesiredTemp - I think it just reflects the current setpoint (i.e. the same value as ManualTemp, StandbyTemp, etc. depending on which mode is currently active). So if mode is 0 and you want to change the setpoint, you change ManualTemp.

If you meant that you are changing ManualTemp, but the update is not registered, please explain again. As I said, I got the change in ManualTemp working both ways (with only short delay).

/Mikkel

Hi,

Iā€™ve been following this closely, good to see itā€™s getting some attention, one question I have is, can the binding set the clock on the AHC 9000?
I find that I have to do this after power cuts and probably the biggest use I have for the screen now that the schedules are set.

@Sthomas: I think you will run into problems if you are using both this binding and a display (two masters on the bus).
Getting OpenHAB integration, I believe the most logical thing to do is move the schedule to OpenHAB, in which case you do not need to set the time on the controller :wink:

Hi,

Yes I can see that logic but my confidence in the system is not yet where Iā€™d be happy to do that. Plus Iā€™d loose the ā€œplayā€ aspect if I (read family) rely on it for heating :wink:

Happy to remove the screen in time and was curious to see if the main function I use of the screen could be automated by openhab - also like an NTP for the AHC9000 :slight_smile:

Not sure if the binding can do it, but I have been setting the time in the controller using my python script. However, that was without the display connected.

The display is quite heavy on the bus usage, so getting a time slot to update the time, without the display interfering with communications does not seem easy, but I have no hard evidence it cannot be made to work with sufficient retries. But I donā€™t know how the display behaves if its communication gets messed up.

Hi Mikkel,

Did you find a solution to the timeouts? I have them too.

/Thomas

Iā€™ve been playing around a bit with the settings. My initial test found ā€œManualTempā€ to be linked to ā€œDesiredTempā€ - when I changed ā€œManualTempā€ it triggered a change of ā€œDesiredTempā€ and also updated the display on the thermostat. All makes perfect sense.
Then I updaeted EcoTemp to 18 degrees (reported as null initially) and that seemed to mess everything up - ā€œModeā€ got updated to 12 and it seemed like ā€œManualTempā€ has been unlinked from the physical thermostat and ā€œDesiredTempā€.
I have tried manually changing ā€œModeā€ to 0 and several other values but no matter what I do it seems that the change is permanent - I have no control from Openhab - but it still gets updates when I operate the thermostat.
Any ideas what might be wrong?

@ThomP: Havenā€™t had time to look at the timeouts. Could there be differences in the USB-to-serial hardware or driver causing this? @zmartify: Could you tell us which USB-to-serial bridge you have used for development?

My initial test of the binding was using only ManualTemp (as the setpoint), and AirTemperature (for getting the current temperature reading). These were reflected by items in sitemap, and I got ManualTemp working ā€œboth waysā€.

However, when I tried to expand the sitemap with an the Mode (pretty much equal to the Selection-item posted by @hpetersen), I got the following behavior: The mode was initially not set to any of the defined values (perhaps null), so it appeared in the selection menu as a new blank item. When I tried to change the mode using the sitemap, it did not seem to set anything on the thermostat.

From my experiments from Python, I know that setting vacation mode shows a little suitcase on the display, but I couldnā€™t get that working using the binding to set ā€œmodeā€.

Maybe I can find a second USB-to-RS485 device and see what is happening on the bus. At this point I find it difficult to determine if it is working or not (or working sometimes). I wonder if there are other ways to debug the binding (@zmartify: would a higher log level reveal something, e.g. seeing when changes are detected, etc.)