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

great integration!!!

Small feature request:
Add a ‘from_joins_no_process_state_on_connect’ section to the control system sync part to avoid getting incorrect state values or processing of these values at reboot/reconnect from Crestron.

For the moment I have zigbee lightbulbs turning on/off when rebooting HA.

scenario:
Zigbee 3 lightbulb hosted on HA/Zigbee2MQTT with usb RF dongle, controlled via HA app and Crestron TSW

setup:
control zigbee lightbulb from Crestron > HA
Crestron TSW Crestron ISC join a1 out > NPOPE a1 from_join >HA ZigbeeMQTTlightbulb

update status zigbee lightbulb controlled via HA app > Crestron
HA > NPOPE to_join a1 > Crestron a1 in

flow:
set Crestron slider to for ex. 100% > Crestron ISC join a1 out = 255 > from_join a1 = 255 > lightbulb turns to 100%
in HA set lightbulb to zero > lightbulb turn to 0% > to_join = 0 > Crestron ISC join a1 in = 0 and Crestron slider goes to 0, the lightbulb is off.

now the problem:
When HA reboots or reconnects, it requests update: a1 from_join and receives value: join a1 out = 255 that HA processes immediately
the lightbulb turns on…

Can you add a “from_joins_no_process_state_on_connect” section for joins that HA does not need to process the value on (re)connect?

this is my code in HA

to_joins:
- join: a1
value_template: >
{% if is_state(‘light.zigbee_testbulb’,‘off’) %}
{{ 0 }}
{% else %}
{{ state_attr(“light.zigbee_testbulb”, “brightness”) }}
{% endif %}

from_joins:
- join: a1
script:
service: light.turn_on
target:
entity_id: light.zigbee_testbulb
data:
brightness: “{{ value|int }}”

many many thx

Absolutely love this integration setup. I was working implementing calls via the API to add HA devices to Crestron, but this is significantly better and great for adding Crestron devices to HA

Wanted to confirm something: I’ve setup a pair of CLW DIMEX’s as lights in the config, and they only show up as Entities and not Devices, so I can’t add them to a room (to quickly control on the GUI). Is that how it currently works, or am I missing an extra step?

Hi,
Any chance I can control my Crestron MD6x6-DM matrix switcher from HA? Crestron is a real headache. I can’t even get the firmware upgrades without an integrator!

Hi,
Many thanks for this integration !
I have an Unique_Id issue with all of kind components :

# Crestron
crestron:
    port: 32768
    
switch:
  - platform: crestron
    name: "Dummy Switch 4119548912"
    switch_join: 65

image

Of course I try with more complex name, but same result.

Do you have an idea ? perhaps something I missed ?

Thanks in advance

1 Like

Hey Nick, I just wanted to say thanks for the time you put into this for all the Crestron users and sorry to everybody else for bumping this. My house is full of Crestron, and it would be nice to get lots of it working with HA or give me many more options!

I have started out getting some of my CLW-DIMEX-P working and have four of them working fine, but I am struggling with the feedback, not a YAML expert but usually, after a couple of days I find my problems but this time, I’m not sure what it is but YAML validators say its fine, but when I go to “Developer Tools/Check Configuration” in Hass, it gives me an error I am having trouble deciphering.

I’ll post my code, and a couple of screen captures, and if anybody knows where I’ve done something wrong, let me know, I only added the To/From join for “A1” and that’s the “Theatre Front” light, and that is the proper entity name from Hass, I didn’t want to add more until the error stopped :slight_smile:

Thanks in advance to anybody that might know what my error is causing this.

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# home-assistant-crestron
crestron:
  port: 16384
  to_joins:
    - join: a1
      entity_id: light.theatre_front
  from_joins:
    - join: a1
      entity_id: light.theatre_front

light:
  - platform: crestron
    name: "theatre_front"
    brightness_join: 1
    type: brightness
    
  - platform: crestron
    name: "theatre_main"
    brightness_join: 2
    type: brightness
    
  - platform: crestron
    name: "office_main"
    brightness_join: 3
    type: brightness
    
  - platform: crestron
    name: "utility_main"
    brightness_join: 4
    type: brightness

You don’t need the light definitions AND the to/from joins.

If all you need is to connect analog/digital/string joins to home assistant for them to appear as lights, thermostats, shades, binary_sensors, sensors, switches or media_players, just use the native HA yaml token (light, climate, cover, binary_sensor, sensor, switch, media_player) with the platform: crestron sub-token without any matching to_joins or from_joins.

The to_joins and from_joins are meant for allowing the use of templates and scripts. In hindsight, the to_joins and from_joins terminology is confusing :frowning:

Since templates are a way to set things in HA with arbitrary logic/complexity when a Crestron join changes, I called it from_joins (Crestron → HA). And since scripts are a way to set Crestron joins with arbitrary logic/complexity when something in HA changes, I called it to_joins (HA → Crestron).

To add to the confusion, the custom component’s implementation of the core HA object types (light, climate, cover, binary_sensor, sensor, switch, media_player) already provide two-way synchronization. So if you use one of these in your config, there is no need to add a to_joins or from_joins to get 2-way sync.

In hindsight, to_joins should probably have been called template and from_joins should probably have been called script. I will try and update the readme to better explain this.

I’m starting to work on adding a config flow so that the component can be set up from the UI. This has the added benefit of adding “devices” to the integration which will allow for locations, device triggers, etc.

The trick is finding time to work on it :slight_smile:

-Nick

Thanks for the detailed info Nick, I did manage to get 22 lights working last night before you had made this reply and fell asleep before mentioning I got that part solved. I can confirm a few different EX brand switches work without a problem.

I have the following working and they all seem snappy and work fine.

2 - CLW-DELVEX-P
14 - CLW-DIMEX-P
6- CLW-SWEX-P

After I got them into HA I started testing Alexa with the Nabu Casa service and while it does work it seems if I manually turn off a switch and then try to turn off using my Alexa command it doesn’t work, anymore, though your component continues to work perfectly which is a good thing.

This weekend I’ll maybe add a thermostat and some temp sensors and I also have two fan controllers I’ll add to my pages so the wife can have access to low/med/high controls.

I’m like the car mechanic who drives a broken car but in Crestron land, it seems I am fixing everybodies crap and neglected my home system for years because I was too busy.

No worries about time Nick, a person can do lots with this component right now, I’ll be trying to figure out more soon because I’m still somewhat a newb to Hass, maybe a year and to be honest I never really delved into scripts and templates, that’s next :wink:

Thanks again!

Hi Nick, when you say “2-way sync” I assume you mean HA knows when I turn off a light at the actual switch and the X-sig is updating HA of the change?

The way things work for me I can turn lights on and off via the UI and it updates the feedback on the UI perfectly, but if I go to the wall switch and turn off the light the UI feedback doesnt go low and HA still sees it as being on?

I can also use Alexa/Siri and turn lights on and off and it updates on the UI and I see the change when I turn them on and off but if I turn a light switch off then try to turn it back on with Alexa that doesn’t work because it. has the wrong state, so I have to say.

Alexa, Office light off, Alexa Office light on <—Say “Off” first because it still thinks its on

Basically I have to do this to get it back in sync :slight_smile:

I assumed if I turned a light off at the switch that the X-sig would pass the analog value to HA and it would know the light is actually off and other ingrations would also but mine isn’t working this way.

If this is the way its supposed to work when I am adding only analogs for each light from the X-Sigs?

Or do I need to use something else in my config file so HA knows I turned off at the switch? It seems my switches should be updating HA or the light.turn_on service somehow?

Thanks!

If anybody can give an example of feedback for a simple dimmer switch I would appreciate it, trust me I’ve been trying daily since I posted last and though I understand way more now I still am having trouble, I wouldn’t be asking if I didn’t try to solve myself.

I am not using this component with just HASS, which syncs fine except after a reboot. My problem is I have switches and TSW’s and if I turn them on or off, that doesn’t reflect on HASS pages, so I do need to use the to_joins and from_joins from everything I can tell.

The help file shows examples for everything but a lighting switch in the readme, and trust me I’ve tried every iteration of that code to get things to properly track state, and obviously I am missing something.

I took an example from earlier in this thread and already it, and I can see the value of my light when it’s off it 0 and on its 257

to_joins:
   - join: a3
  value_template: >
  {% if is_state('light.office','off') %}
  {{ 0 }}
  {% else %}
  {{ state_attr('light.office', 'brightness') }}
  {% endif %}

If I paste in the Template section of Developer tools, I can see the feedback, where I am somewhat confused is, does this get added into my configuration.yaml?

I understand where the scripts go and where you make them, and I know that once made from the UI they end up in scripts.yaml, this is where my next problem occurs.

Again using the example code above I take this code for the “from_joins”

from_joins:
  - join: a3
    script:
    service: light.turn_on
    target:
    entity_id: light.office
    data:
    brightness: “{{ value|int }}”

Now if I go to the “Script” section of Hass and I have the visual UI, I can put in a couple of these params like the service and entity but the brightness value I don’t see no way to do that, I try switching to YAML and paste it in and get errors so I am stuck, for well over a week now trying everything under the sun.

I really didn’t want to ask for help, but I tried for more than a person should have to, lol…seriously feeling defeated with something that seems like it should be easy but I don’t have a clear example.

I don’t need to be handheld or need someone to do everything for me, but I have to say I’m confused and need some direction.

  1. If my dimmer switches when pressed on/off do not update on my interface, then I need the to_joins and from_joins? From everything I see in my system, I need something to give me feedback from the switches themselves.

  2. If yes, then I need a template for my “to_joins” and I assume my code above is correct and that template code gets posted inline in my config file? If not, where exactly does it go and is that code correct?

  3. I know I need to make a script for the “from joins”, as mentioned I tried using the script section but the code I posted above gives an error, am I supposed to be posting it in the script section of developer tools, I can’t seem to add the brightness attribute, when I try to add in yaml it gives me an error.

I thought maybe I just put it in scripts.yaml and make sure I have the right indentation, which it seemed I did, but again, something just isn’t right, or I’m missing some important info…lol.

Last but not least, I plan to use this with more than a single light and will need to add 22 dimmers in total, so do all my light entities go into a single string or something and then they can use the same block of code?

Any help is truly appreciated. Trust me I probably spent over 30 hours trying everything, watching videos, reading the forums and trying so many different things.

At this point, if someone needs a donation to assist just private message me, if the answers were obvious I would have found them by now or I’m missing something I don’t understand yet.

During all this madness, I managed to configure my Doorbird doorbell to send me photos and play the Jetsons doorbell over all my Echos, so hey, I’m learning and not afraid to admit I’m still very much a noob to HASS :slight_smile:

To set up a light don’t use to and from joins. Use the Crestron platform under lights.

Can help you more with screenshots from simpl side of you need.

Thanks for the reply Adam; appreciated.

I have my config file set up the exact same as yours.

light:
  - platform: crestron
    name: "screen"
    brightness_join: 1
    type: brightness
    
  - platform: crestron
    name: "theatre"
    brightness_join: 2
    type: brightness
    
  - platform: crestron
    name: "office"
    brightness_join: 3
    type: brightness
    

However, when I turn off the light switch on my Crestron system it’s not updating in HA or Vice versa.

So if you turn on a light using a button in HASS and then walk over to the switch and turn it off by hand, does the light show as “OFF” is HASS? Mine doesn’t, and I’m not getting feedback. Or if the HASS screen with all my light buttons show them as off and I start turn on lights with the actual wall switch, that’s not seen by HASS and they still show as Off.

Or if say my wife says, “Alexa, turn on the Kitchen light” and I come in and turn the light off at the actual switch and then she tries to use Alexa to turn it on again, Alexa has no idea I turned it off manually with the Crestron EX switch on the wall so it’s out of sync.

If you don’t mind, post a capture of your Xsig showing your light analogs, maybe I have something configured wrong in the Xsig, the way I have it now I have the same name on both sides in/out because I was confused about how exactly it would be talking back to HASS.

Thanks in advance!

I will post a screen cap of my xsig later today but in the meantime make sure you have the same signal on both sides of the xsig for that join number and on the dimmex symbol make sure you have it for both light brightness and light brightness feedback.

Thanks, Adam. I have the same signal in the Xsig on both sides, which is connected to an EISC because my Lighting program is in Slot 2 of a C3P.

So as an example, my Office light is analog 3, and the same signal is going in and out of the XSIG and its named [Office][Office_Light]Level , this signal is coming from my EISC, which connects to the lighting program in Slot 2.

Inside my D3 program if I search for the signal [Office][Office_Light]Level I am using in my XSIG
I don’t see it in the DIMEX symbol, instead I see it in the Remote System I generated and its not the exact name it has RS106[Office][Office_Light]Level

It also find it in a serial buffer

*Note in the RSD in110$ is named RS106[Office][Office_Light]Level and then out110$ is [Office][Office_Ceiling_Light]Level which is the signal I am using in the XSIG and I get that from the RSD file I import and it controls the light properly with the exception of the feedback from the switch.

Two other signals in my RSD also show values changing in debugger from 0-65536 and they are

—————————————————————————————————————
[Office][Office_Light]Current_Level
##################################################################
This signal I can toggle on and off in lovelace and I can tell Alexa to turn the light on and off and I see the feedback in debugger for off being “0” and on being “65535” however the light does not turn on or off but the feedback changes.

##################################################################

————————————————————————————————————
[Office][Office_Ceiling_Light]Current_Level.
##################################################################
Does not turn on or off with HA from lovelace buttons or with Alexa, turns on/off from switch as it should but feedback does not changs when its used in the XSIG, when its NOT in the XSIG the feedback updates if using the [Office][Office_Light]Level signal in the XSIG instead.
##################################################################

So at this point I’m not sure if its the signals D3 is giving me in the RSD causing the problem or something else, sorry for the long reply but really no other way to explain it.

I wanna keep my lights in Slot 2 in D3 if possible but if it comes down to it and I have to make a program using all using just the DIMEX symbols I’ll have to do it, it just seems very odd I can see the light values changing in debugger but its not properly updating.

I am not sure about all of yours but this is how mine is and it works.


1 Like

I finally have got it working! A few hours ago what I did is I put a CLW-DIMEX-P symbol in my slot one program and passed the same signal names I posted and rebooted and everything works as it should.

Whats puzzling is why the same signal coming from an EISC to the XSIG does not work the same, the same EISC I use for light control on touchpanels and switches, fans and it works fine?

Thank you Adam for hopping in and offering help, you sent my mind into hyperdrive today and when you mentioned about the DIMEX symbol I looked in my D3 program in Slot 2 and then I thought, why not just put a DIMEX symbol in Slot 1 and test it just to see if it works and wow, it works!

Hopefully someone else can explain why the same signal from an EISC doesn’t work when going to the XSIG, trust me…I tried everything you could imagine and I’m still puzzled. :slight_smile:

Thank you Adam!

Glad it worked out and that I have gave you the spark. Enjoy!

1 Like

I am controlling my lights from Crestron as well except that I use different signal names in Simpl for changing the light level and getting the feedback from the lighting system as to what the current level is. I pass the feedback signal to HA via the analog input on the xsig. The xsig receives the command from HA to change the light level via the analog output of the xsig. Using this method allows you to more easily map your signal flow. Here is a screen shot of my xsig.

Hi, I have Crestron Home and I am familiar with the scenes and other setup components in the installation and setup program. However, I am not familiar with the control system concept. Since I am a programmer I assume it can’t be too hard. Can someone point me in the right direction? I’d love to get my Crestron integrated with HA. Sorry for the newbie question.

Grayson

I don’t have a Home processor, but for sure, you won’t be able to load an Xsig symbol using the setup program on an iPad or anything like that. To get this working with Crestron Home, you would probably need another Crestron processor that you would have the Xsig on that HA communicates with, and then your Crestron Home processor would send commands to that via EISC or whatever method CH uses.

Perhaps another programmer with Crestron Home can comment on how you talk to another processor to control stuff, but I have only programmed with SIMPL and S+. As far as I know, Home doesn’t even have a debugger built-in, and it’s still elementary. You can use plenty of older equipment with it, but you’re pretty limited with other things you can easily do in SIMPL.

Depending on what level of Crestron programming you’ve take this page has plenty of info and will lead you down the rabbit hole, so to say. https://sdkcon78221.crestron.com

Thanks, @ddetton. I was using EX switches in slot2 to my lighting program and even when I changed names to the known FB I saw ramping in the debugger, it still didn’t seem to work for me, drove me nuts!

I’ll test things again in my spare time again, I have everything working fine with my dimmers in slot1 where my program is using modules there and working 100% with Alexa and Siri commands, have to say the wife really likes that convenience.