Sinope Zigbee Thermostat TH1123ZB

The Karaf console comes with a full-fledged SSHd and there is executeCommandLine … So something like executeCommandLine( 'ssh -l openhab <local ip address> -p 8101 "zigbee ..." ') (pseudo-code - I’m too lazy to check the syntax of executeCommandLine) should do the trick.

Ah, gotcha, thank you. Installing the second tstat today and manually sending the command.
Shouldn’t need to send more than once each so this is working pretty well.

Hi @chris ,

Just wanted to say, if you are adding this function directly into the binding with the static definition, there are a couple other options these normally support that I may also be able to get working.
On-screen display of current time, outdoor temperature, the choice of what to display on the screen, as well as settings for the type of heater attached.

They also have a 4000W version with the same options. I don’t have one but know where I could borrow one to get the XML/fingerprint.
Probably identical settings, just a different model identifier.

Might be worth it if we can say the binding “fully supports” the Sinope ZigBee thermostats.

Once added with the static definition how are these options chosen?
Maybe it is just the devices I have tried but it seems like ZigBee devices don’t have options in the Thing configuration like ZWave devices have an abundance of.

Busy week but should be able to do some trial and error to get those going.

Had a look at the additional functions. Also looked over some of the static definitions in the ZigBee GitHub.
Looks pretty straightforward.
Just wasn’t quite sure about the channel naming convention but now that I think about it that may be straight out of the XML file?

Was able to borrow a 4000W thermostat to run fingerprint on and grab the XML file.
Also ordered one of their low voltage thermostats to run my fireplace.
Will fingerprint that when it arrives.

If it will save you some time I can try modifying and adding to the multi sensor static binding from the GitHub page to suit and then post for proofreading?

2 Likes

Yes, the channel names are defined in the XML - the channel types are defined in another XML (called channels.xml I think) on Github.

If you’re happy to work through this and give it a shot, that would really be very much appreciated.

Quite happy to contribute.

EDIT: Answering a lot of my own questions digging into the github. Will keep going with that before asking more questions until I really get stumped.

Happy to help test this if you need. I have several of the 4000w ones. I have been looking to use the additional features as well. Thanks so much for digging into this.

Sounds great. Looks like the commands are the same between the 3000W and 4000W versions.
The static definition may be general enough to work with both or we may need two almost identical static definitions.

@chris From the static definition documentation I see the following example that has “18” as the datatype.
What numbers correspond to which datatypes?
Currently one configuration attribute is an UNSIGNED_16_BIT_INTEGER and one is ENUMERATION_8_BIT.

The elements of the attribute definition are attribute_endpoint_clusterId_attributeId_dataType.

			<parameter name="attribute_02_0000_0033_18" type="integer">
				<label>LED Indication</label>
				<options>
					<option value="0">Disabled</option>
					<option value="1">Enabled</option>
				</options>
			</parameter>

Also, when defining a completely custom channel how do we define the attribute and datatype?
Please see the following example:

<!-- 
Custom channel to SEND outdoor temperature data TO the device. 
The device accepts this as degrees centigrade * 100
ex: 5.5 degrees celsius is sent as 550 or "zigbee write 61911/1 0xFF01 0x0010 550 SIGNED_16_BIT_INTEGER"
Not sure how we can handle fahrenheit conversion for americans? 
Can we do logic functions in the static definition?
-->
			<channel id="Send OutDoor Temperature" typeId="measurement_relativehumidity">
				<properties>
					<property name="zigbee_endpoint">1</property>
					<property name="zigbee_inputclusters">0xFF01</property>
how to define attribute?		<property name="zigbee_attribute">0x0010</property>
how to define datatype?			<property name="zigbee_datatype">SIGNED_16_BIT_INTEGER</property>
				</properties>
			</channel>

Also, any ideas on the noted issue of sending temperature in fahrenheit?

To add an attribute into the configuration, you need a section like below. Note that you MUST include the first one (zigbee_macaddress).

IIRC, the attribute is defined as follows -:

attribute_02_0000_0033_18 -:

02 is the endpoint, 0000 is the cluster, 0033 is the attribute, 18 is the data type. You can find a list of the data types here -:

        <config-description>
            <parameter name="zigbee_macaddress" type="text" readOnly="true" required="true">
                <label>MAC Address</label>
            </parameter>

            <parameter name="attribute_02_0000_0033_18" type="integer">
                <label>LED Indication</label>
                <options>
                    <option value="0">Disabled</option>
                    <option value="1">Enabled</option>
                </options>
            </parameter>

            <parameter name="attribute_02_0406_0030_18" type="integer">
                <label>Sensitivity</label>
                <options>
                    <option value="0">Low</option>
                    <option value="1">High</option>
                </options>
            </parameter>
        </config-description>

Commands to the device are always sent as Celcius - this is a standard for Zigbee. I believe there is another cluster called something like Thermostat UI that allows configuration of the display but I’ve not added support for this, but it could be done if it’s needed.

Great, thanks @chris

-The configuration attributes should be pretty good.

-You’ll see my attempts at defining custom channels at the top for outdoor temperature and time.
I hope I went about it correctly but wasn’t sure how to define the attribute and datatype within channel properties.

-I added properties for the typeMatcher. Can I do two typeMatcher:modelId lines so this static definition will match with both models, their 3000W and 4000W versions?

-A few misc comments were left in for reference.

When you have some time to check it out please let me know how it looks, what to change, and I’d like to figure out how to test it.

<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="zigbee" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
	xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">

    <thing-type id="Sinope_tstat" listed="false">
        <label>Sinope TH1123ZB & TH1124ZB Thermostats</label>
        <description>Sinope Technologies Line Voltage Thermostat</description>

        <channels>
<!-- 
Custom channel to SEND outdoor temperature data TO the device. 
The device accepts this as degrees centigrade * 100
ex: 5.5 degrees celsius is sent as 550 or "zigbee write 61911/1 0xFF01 0x0010 550 SIGNED_16_BIT_INTEGER"
-->
			<channel id="Send OutDoor Temperature" typeId="Outdoor_temperature">
				<properties>
					<property name="zigbee_endpoint">1</property>
					<property name="zigbee_inputclusters">0xFF01</property>
<!-- how to define attribute? -->		
					<property name="zigbee_attribute">0x0010</property>
<!-- how to define datatype? -->		
					<property name="zigbee_datatype">SIGNED_16_BIT_INTEGER</property>
				</properties>
			</channel>

<!-- 
Custom channel to SEND current time TO the device. 
ex: 
-->
			<channel id="Send Current Time" typeId="current_time">
				<properties>
					<property name="zigbee_endpoint">1</property>
					<property name="zigbee_inputclusters">0xFF01</property>
<!-- how to define attribute? -->		
					<property name="zigbee_attribute">0x0020</property>
<!-- how to define datatype? -->		
					<property name="zigbee_datatype">UNSIGNED_32_BIT_INTEGER</property>
				</properties>
			</channel>

<!-- Default Outdoor temperature channel is useless. Doesn't accept writing, doesn't display the outdoor temperature when it is set.
Commenting it out.
            <channel id="Outdoor Temperature" typeId="thermostat_outdoortemp">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>
-->

            <channel id="Running Mode" typeId="thermostat_runningmode">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>

            <channel id="Voltage" typeId="electrical_rmsvoltage">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>

            <channel id="Temperature" typeId="measurement_temperature">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>

<!-- I don't think the thermostat actually supports unoccupied setpoints. Commenting out.
            <channel id="Unoccupied Heating Setpoint" typeId="thermostat_unoccupiedheating">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>
-->

            <channel id="Metering Summation Delivered" typeId="metering_sumdelivered">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>

<!-- What's the difference between "Local Temperature" and the "Temperature" channel above? -->
            <channel id="Local Temperature" typeId="thermostat_localtemp">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>

            <channel id="Total Active Power" typeId="electrical_activepower">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>

            <channel id="Occupied Heating Setpoint" typeId="thermostat_occupiedheating">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>

            <channel id="System Mode" typeId="thermostat_systemmode">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>

            <channel id="Current" typeId="electrical_rmscurrent">
                <properties>
                    <property name="zigbee_endpoint">1</property>
                </properties>
            </channel>
        </channels>

        <properties>
            <property name="typeMatcher:vendor">Sinope Technologies</property>
            <property name="typeMatcher:modelId">TH1123ZB</property>
            <property name="typeMatcher:modelId">TH1124ZB</property>
            <property name="zigbee_logicaltype">ROUTER</property>
        </properties>

        <config-description>
            <parameter name="zigbee_macaddress" type="text" readOnly="true" required="true">
                <label>MAC Address</label>
            </parameter>

           <parameter name="attribute_01_0201_0402_30" type="integer">
                <label>Backlight</label>
                <options>
                    <option value="0">On Demand Only</option>
                    <option value="1">Enabled</option>
                </options>
            </parameter>
<!--
Backlight Successful command:
zigbee write 43799/1 0x201 0x402 0 ENUMERATION_8_BIT
-->


            <parameter name="attribute_01_0204_0000_18" type="integer">
                <label>Temperature Display Mode</label>
                <options>
                    <option value="0">Celsius</option>
                    <option value="1">Fahrenheit</option>
                </options>
            </parameter>
<!--
Temperature Display Mode Successful command:
 zigbee write 61911/1 0x204 0 1
-->


            <parameter name="attribute_01_0204_1_18" type="integer">
                <label>Keylock</label>
                <options>
                    <option value="0">UnLock Keys</option>
                    <option value="1">Lock Keys</option>
                </options>
            </parameter>
<!--
Keylock Successful command:
 zigbee write 61911/1 0x204 1 1
-->


            <parameter name="attribute_01_FF01_0011_21" type="integer">
                <label>Outdoor Temperature Display Timeout</label>
                <options>
                    <option value="14400">Four Hour Timeout</option>
                    <option value="0">Disable Outdoor Temperature Display</option>
                </options>
            </parameter>
        </config-description>
<!--
Outdoor Temperature Timeout Successful command:
zigbee write 61911/1 0xFF01 0x0011 14400 UNSIGNED_16_BIT_INTEGER
-->

            <parameter name="attribute_01_FF01_0114_30" type="integer">
                <label>12hr/24hr Clock Setting</label>
                <options>
                    <option value="0">12-hour Clock Display</option>
                    <option value="1">24-hour Clock Display</option>
                </options>
            </parameter>
        </config-description>


            <parameter name="attribute_01_0201_0401_33" type="integer">
                <label>Heater Type</label>
                <options>
                    <option value="15">Baseboard/Convectors</option>
                    <option value="900">Fan Forced Air</option>
                </options>
            </parameter>
        </config-description>

    </thing-type>
</thing:thing-descriptions>

You don’t need the properties section that lists the vendor etc. This needs to be added elsewhere in the binding - there is a discovery.txt file that is used for this purpose. Otherwise I think this looks ok.

I would suggest to create a PR on Github and I can look through it properly there and comment more easily on anything that looks strange. Then we can get it added to the snapshot and you should be able to test it out reasonably easily.

It’s a little sad that they used their custom cluster to support standard functions such as time and temperature :frowning: .

Sounds great. I’ll clean it up a little and get it on github.
Received their low voltage thermostat yesterday so might just get it fingerprinted, etc, soon and do it at the same time.

Cheers,

@chris
A pull request has been created to add three static definitions for the 3000W, 4000W, and low voltage thermostats.
I believe these add all features of the thermostats except setting the minimum and maximum allowed temperatures.

Seemed like a less-used function and wasn’t sure how to add a text field to the configuration for entering the maximum and minimum desired temperatures.

If it looks good and gets added to the snapshot I’ll test everything I can, but any additional testers would be welcome, @Pierre-Luc_Pelletier

2 Likes

Happy to help test, just let me know when we can try.

Hi @chris

I didn’t understand how to test this prior to having it integrated into the snapshot but think I have it.

With the static definitions added to my kar file and the binding reinstalled I get the sinope stats in my Thing inbox but even with the old Things deleted I get “Error during thing creation: conflict” when trying to add them.
Tried:

sudo systemctl stop openhab
sudo openhab-cli clean-cache

And rebooting with no luck.
Not seeing a whole lot about this error but I am guessing it has to do with my new channels within the static definitions.
Any ideas?

Thanks in advance

Sorry - I’ve been a bit busy over the past week or so so - can you provide a debug log showing the error and I’ll take a look.

Found it.

12:53:00.886 [ERROR] [enhab.core.thing.binding.ThingFactory] - Thing factory (class org.openhab.binding.zigbee.internal.ZigBeeHandlerFactory) returned null on create thing when it reports to support the thing type (zigbee:sinope_TH1400ZB-Low-Voltage-Thermostat).
12:53:00.887 [WARN ] [ig.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type zigbee:sinope_TH1400ZB-Low-Voltage-Thermostat.
12:53:05.689 [INFO ] [openhab.event.ConfigStatusInfoEvent  ] - ConfigStatusInfo                                               [configStatusMessages=[]]

Edit: Oh, I’m guessing I formatted the discovery.txt incorrectly.

I think the problem is that in the discovery.txt file, you gave the thing one name, but in the thing XML files, it a different name…

These two thing types need to be the same. I suspect that you thought that the name in the discovery.txt file is the name of the file, but it’s not - it’s the name of the thing since the XML files are read separately by the core and the discovery file is read by the binding - the only link is the thing name.

That’s exactly what I thought. Correcting and testing shortly.

Thank you

1 Like

While we’re both active, one more beginner question. You mentioned running the code through the formatter.
Is that built into github or a separate xml formatter?
Thanks