Crestron - custom component to integrate a Crestron control system via XSIG

Sorry, I missed this before.

If you have two different joins, then you need two different yaml entries. IOW, this will show up as two different sensors in HA, then you would pick the UI element that knows how to display temp + humidity.

I think your yaml should read:

sensor :
   - platform: crestron
     name: "Office Temperature"
     value_join: 18
     device_class: "temperature"
     unit_of_measurement: "°C"
     divisor: 10
   - platform: crestron
     name: "humidity"
     value_join: 19
     device_class: "Humidity"
     unit_of_measurement: "%"

This will result in two sensors on the HA side (mapped to your two analog joins).

Basically, there needs to be a 1:1 mapping from joins on the Crestron side to sensors on the HA side.

Hope that helps.

-Nick

The reason I ask, is I have a pretty involved smart home built around HA and I would really like to include some Crestron products, particularly shades and keypads because I think they are the best on the market. I have a friend and neighbor is a dealer/integrator and is willing to work with me to make this happen if we can figure out a way. I would be to operate shades via home assistant and potentially trigger home assistant with keypads. It seems like this is possible with your component. your custom component seems like the best way to tie the two together I have encountered thus far.

I wanted to get a sense of how realistic it is to base my investment off of it though, if it really works and will continue to work. It sounds like it does work.

It would be great if keypad input could be used to create an HA event.

Your keypad can, use the button to send an Ip string via tcp/ip to HAS. Use node red to interpit and send and make an event happed in Home Assistant.

How do I do that exactly on the Crestron side? I’m not the Crestron guy myself but my friend is and has been helping me so I want to give him very clear feedback on how to do it.

I’m also having another issue with this module. When it works, it works perfectly but every 10-12 hours the my devices all become unavailable. I can still see the join events happening in the HA log if I set the Crestron component to debug level so it seems the Crestron unit is still connecting to HA, its just an issue with the devices created by the integration. A restart of home assistant fixes it. Would appreciate any troubleshooting ideas.

This is what I’m getting in my log when the Crestron devices go offline.

2021-05-11 13:05:07 INFO (MainThread) [custom_components.crestron.crestron] Control system connection from ('10.10.70.1', 58386)
2021-05-11 13:05:07 DEBUG (MainThread) [custom_components.crestron.crestron] Sending update request
2021-05-11 13:05:11 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
2021-05-11 13:05:12 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
2021-05-11 13:05:13 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 4845
2021-05-11 13:05:13 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 4c50
2021-05-11 13:05:13 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 0d0a
2021-05-11 13:05:20 INFO (MainThread) [custom_components.crestron.crestron] Control system disconnected
2021-05-11 13:05:20 INFO (MainThread) [custom_components.crestron.crestron] Control system connection from ('10.10.70.1', 58488)
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Sending update request
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 4745
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 5420
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 2f3f
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 4341
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 5649
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 5420
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 4854
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 5450
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 2f31
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 2e31
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 0d0a
2021-05-11 13:05:20 DEBUG (MainThread) [custom_components.crestron.crestron] Unknown Packet: 0d0a
2021-05-11 13:05:21 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
2021-05-11 13:05:22 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable

A reboot of HA solves it, a reboot of the Crestron processor does not.

No idea why I didn’t look at this earlier, been trying to get status feedback from the tv’s I have back into HA, initially i started with sending a API string that contained the MQTT API token and payloads to the MQTT server and then HA would pick up the status from there unfortunately the series 2 processor I’m using runs out of buffer space for the signals as the API key is pretty long. I already have a working interface to trigger various CEC based commands to the tv’s and to control apple tv players and control the volume on a RMC-200-C but the feedback has been an issue to keep all the entities synced.

I’m going to have a play with this when I get home as once I can get status info of the TV’s (I’m already getting the CEC status showing up in the Crestron debugger) then I can start really playing with alarm\wakeup routines and goodnight routines as currently my blanket one just kills the power to the AV gear, which was fine whilst it was just myself and the better three quarters but now we have others living with us, knocking out their movie\tv\music isn’t what I need to be doing.

I’m going to try and get the Crestron system integrated in HA at my sister’s house. I don’t know anything about Crestron. Is there a document that is worth reading to get a bit up to speed. I don’t know what joins are and what it does and anything. But I don’t want to bother you with any dumb questions. So just wanted to know if there is a document that gives most answers to learn for me for the integration into home assistant.

I know there is no document specifically for this. But maybe the documentation for the specific devices/protocols/elements that is required within Crestron

Hi there, thanks for the component and the work you have done.
I have managed to get the analogue values from my crestron processor into the HA. However, I have not been able to get the sensor temperature and humidity from HA into my crestron processor. The Code I used is as follows:

crestron:
  port: 32768
  to_joins:
    - join: a1
      entity_id: sensor.ble_temperature_a4c138222d6e
      attribute: temperature

I know the temperature sensor is working because I can see it in my dashboard.

Any ideas on how to get analogue values from HA to Crestron?
Thanks.

Found the issue. I removed the attribute line and it worked.

@At3 Crestron is a high end professional Automation platform that is usually programmed with trained and certified programmers. The module you need is listed in the github link. If you are integrating into an existing Crestron system it will be difficult to assist you as we would not know the existing program or what blocks it is already using or what its controlling.

Hi
Thank you for your post in regards to Crestron and HA integration.
I have been integrating systems with Crestron for quite sometime now but am a complete virgin with HA, literally 4 days. I would really like to get the two systems talking together.
I downloaded your files, configured my crestron system and added your “crestron” file to my “custom_components” directory in HA. I then added the crestron: block to my conf.yaml. (as the bare minimum)
I tested and got
Component error:crestron - integration ‘crestron’ not found.
I did some research and found a post suggesting I might need a version: in the Json file. I tried this but to no avail.

Is there something simple I’m missing?

Any help would be appreciated

For those trying to install this integration, please have a look at the github “open issues”, which I don’t offen do ;-), luckily for me it only cost me 30 minutes to solve…

“The custom integration ‘crestron’ does not have a valid version key (None) in the manifest file and was blocked from loading. See Custom integration changes | Home Assistant Developer Docs for more details”

“The version key is required from Home Assistant version 2021.6”

Just add a version key in the manifest.json and it will load properly

Hi

Thanks for the share and it’s a great idea but why not move them completely over HA and get rid of Crestron stuffs ? I’m thinking about it for some residential customers as HA allows far more flexibility and also lot more adapted at modern devices like media players, lot more of exotic integrations not existing in Crestron (tesla cars, aquarium equipments…) not even talking about HMI interfaces and device tracking…

This is a good question. However, I believe that thinking about Crestron and Home Assistant as mutually exclusive misses a great combination. They really do work well together. Thus, my motivation for creating the integration. Home Assistant’s superpower is being the glue between everything in your home.

Programming complex logic into the Crestron is tedious and painful. The programming tools are antiquated and require Windows (which may or may not be what you already use). However, it is currently hard to find physical user interface elements that can rival what Crestron has to offer (keypads, touchscreens, remotes). Also, that “old school” approach Crestron takes with its products often means that Crestron gear is built like a tank, and works for years and years.

So, my approach to automating my own home is to take full advantage of Home Assistant as the glue between other systems (HVAC, security, irrigation, lighting, custom-built ESPHome components, etc.). HA gives you freedom to choose best of breed/best fit-for-purpose for each of the “other systems”. This is especially true if you can leave the logic/complexity out of the other systems so the complicated stuff is all centralized in HA, where it’s easy to change and reason about.

So my motivation for building the integration was to get all the complicated logic OUT of my Crestron system. I am able to use my Crestron keypads, touchscreens, motorized shades, HDMI matrix switcher, and audio matrix switcher, etc. with the Control System as a bridge between the Crestron gear and Home Assistant. I just build a basic program in the control system that has all the Crestron functions exposed as digital, analog and serial joins. I rarely ever touch the Crestron program anymore, unless I add a new device or want to rearrange a touch panel screen.

I will say, the most likely thing I’ll get rid of first are the touchscreens (unless I can figure out a way to display the Lovelace UI on them). But the I have not found anything that can match the hard-button keypads, RF remotes, motorized shades, HDMI and audio matrix switchers. So those will stick around until I find something better.

I know Crestron gear has the stigma of being outdated and overpriced. I suppose it is for the most part. But, if you have access to the programming tools, you can find some pretty spectacular bargains for used gear on eBay. Combined with the HA integration, it makes for a compelling combo.

Just my $.02

-Nick

3 Likes

@Nick Thanks for the share of your ponit of view and I fully agree with you on that that’s why I was thinking among other things get some integrations in HA to be able to use some great devices of crestron like the NVX products (they have an API to use them without crestron controller, and in the other way try to bring ESPHome API in Crestron to be able to use some simple electric ESP based devices that can be really useful in Crestron systems for some simple/easy integrations :wink:

Oops. Missed the new mandatory “version” key for the manifest.json in 2021.6 in the release notes. Just created a new release (v0.2.4) that has the added key.

Hello @npope ,
Thank you for the interesting component.

But I have a few problems.

With Crestron I don’t see 20,6 but only 20 C at temperature. What do I have to adjust so that I also see 20.6 C at Crestron?

And how can I operate a Tasmota switch via Crestron. The Tasmota Switch is integrated in Home Assistant and operable?
But I want to be able to operate the switch via a TSW.

PS: Sorry for mij bad english

Just got this working, loaded the new version, added code and got values coming through first go!

but…

My switch process for turning on a TV is this:

Telnet switch issues a text command “LoungeTV On” to the Crestron processor
This is put through a serial buffer in the SIMPL program than then triggers the CEC control tp power the tv on
The CEC control then signals that the tv is on
This is put through to a toggle control along with the off signal that then outputs a stable binary on or off state
This toggle output is connected to the XSIG control, through the serial client to HA and arrives as a binary sensor which is successfully updated.

So…

What I can’t figure out is how to include this sensor value as the switch state on the interface. i am getting a true\false state from the value template

    loungetv_power:
      name: "Lounge TV Power"
      resource: "A.B.C.D"
      port: EFGH
      command_on: "LoungeTV On"
      command_off: "LoungeTV Off"
      command_state: ""
      value_template: "{{is_state('binary_sensor.lounge_tv_status', 'on')}}"

If I keep the command_state: “” item in as above then I don’t have to use the assumed_state: false customisation but regardless whether I have one or the other the status doesn’t update. Really teh assumed state is just an aesthetic having a slide switch like everything else instead of 2 discreet on\off buttons

The one thing I really like is that even if you use the IR remote the status gets updates so everything stays in sync as the Crestron is polling each device the status is always updated.

HI

I need multiple motion sensors from Creston in HA

My HA test config configuration.yaml:
#--------------------------------------------------------
#Crestron
#--------------------------------------------------------
crestron:
port: 32768
switch:

  • platform: crestron
    name: “crestron_Switch”
    switch_join: 11

binary_sensor:

  • platform: crestron
    name: “crestron_lamp_1”
    is_on_join: 10
    name: “crestron_lamp_2”
    is_on_join: 12
    device_class: power

#--------------------------------------------------------
#END Crestron
#--------------------------------------------------------

by entities only Crestron_switch and Creston_PIR_2 is available

In the log files :
2022-01-20 08:32:10 WARNING (SyncWorker_0) [homeassistant.util.yaml.loader] YAML file /config/configuration.yaml contains duplicate key “name”. Check lines 150 and 152

2022-01-20 08:32:10 WARNING (SyncWorker_0) [homeassistant.util.yaml.loader] YAML file /config/configuration.yaml contains duplicate key “is_on_join”. Check lines 151 and 153

How can i get more motion sensors?

Martijn