Jump to content
c4forums | The Control4 Community

What Did You Automate Today?


Recommended Posts

If you look at the lua code for the MCEC driver this is the section that takes input:

function ReceivedFromProxy(idBinding, strCommand, tParams)

    if ( idBinding == 5000 ) then 
    
       Connect();
       
       if ( strCommand == "ENTER" ) then strCommand = "RETURN" end
       if ( strCommand == "PVR" ) then strCommand = "M" end
       if ( strCommand == "CANCEL" ) then strCommand = "ESCAPE" end
       if ( strCommand == "SCAN_REV" ) then strCommand = "Z" end
       if ( strCommand == "SCAN_FWD" ) then strCommand = "X" end
       if ( strCommand == "MENU" ) then strCommand = "F11" end
    
       socket:Write( "VK_" .. strCommand .. "\r" );
    end

end

So if you add if statements for the volume commands then you should be able to send that command through to the PC.  But that assumes that the PC takes action if it receives the code.

Right now these are the only commands (Enter, PVR, Cancel, Scan_rev, scan_fwd and menu) that are actively being sent to MCEC.

 

Link to comment
Share on other sites


Also, the driver needs to have bindings for the audio endpoint or video's audio endpoint and audio volume / video's audio volume, in order to receive those commands from the room, and the project needs to be setup to have that driver connected to those bindings.

Otherwise, the driver itself won't ever get volume commands through the proxy binding (5000, in this case).

RyanE

Link to comment
Share on other sites

Thanks Ryan, I didn't think about that.  Could you just merge this MCEC driver with a no control driver which would have the AV bindings.  I have a PC in my system today that uses a driver called nocontrol_generic_pc.c4z. It has the following documentation:
 

Control4 No Control Driver for PC

Although it is not possible to control this device from Control4 this driver enables it to be displayed on the Control4 UI and for the Control4 system to switch the necessary AV settings.

Using the Property you should select the device that the Control4 system should control to when this device is selected.  This is usually the audio endpoint in the room so that the customer has volume control from their Control4 remote.
Note the driver assumes that this device is locally in the room and not connected to a matrix switch.

Under the Device to control property I have my matrix amp.

Link to comment
Share on other sites

I don't know if the no-control drivers have the room bindings.

The documentation you quoted makes me think they don't.

It wouldn't be hard to add the XML as well as the Lua code to handle the volume commands to the MCEC driver, though.  Probably easier than trying to combine it with some other driver.

RyanE

 

Link to comment
Share on other sites

5 hours ago, zaphod said:

If you look at the lua code for the MCEC driver this is the section that takes input:


function ReceivedFromProxy(idBinding, strCommand, tParams)

    if ( idBinding == 5000 ) then 
    
       Connect();
       
       if ( strCommand == "ENTER" ) then strCommand = "RETURN" end
       if ( strCommand == "PVR" ) then strCommand = "M" end
       if ( strCommand == "CANCEL" ) then strCommand = "ESCAPE" end
       if ( strCommand == "SCAN_REV" ) then strCommand = "Z" end
       if ( strCommand == "SCAN_FWD" ) then strCommand = "X" end
       if ( strCommand == "MENU" ) then strCommand = "F11" end
    
       socket:Write( "VK_" .. strCommand .. "\r" );
    end

end

So if you add if statements for the volume commands then you should be able to send that command through to the PC.  But that assumes that the PC takes action if it receives the code.

Right now these are the only commands (Enter, PVR, Cancel, Scan_rev, scan_fwd and menu) that are actively being sent to MCEC.

 

Yes this is precisely where I'm at in the thought process, and Ryan confirmed some other suspicions. Thankfully C4 offers a driver development course but definitely not a strong area for me.

Link to comment
Share on other sites

  • 1 month later...

I automated something very basic but a little different today...

We have had Hadedas (a fairly large annoying bird in the Ibis family) start visiting our garden regularly (15 or 20 times a day) to look at our fish (probably with nefarious thoughts in mind... ) They are an annoying noisy bird (although I can live with the noise but not with the mess they make as they eat a lot and what goes in must come out) and considered a pest (by many people) in South Africa.

I have been looking everywhere for a solution (tried plastic snakes around the fishpond and not prepared to try any of the options that would harm the birds).  
 

On Friday my gardener said that what we need to do is attract a bird of prey into the garden.  This got me thinking and I have created an announcement which plays falcon bird sounds for 10 seconds on all our outdoor speakers (3 zones)  I have linked this to a double tap on our garden lights button.  The first time I tried it, the Hadedas took flight within seconds. 
 

I have also added a repeating timer which will play these sounds every 15 minutes during daylight hours unless an override experience button has been selected.  It will not play in any of the outside zones which are currently active on the assumption that music playing means people around and no birds...

I must say that from within the house when the announcement plays it sounds like a very pleasant bird sound and not recorded at all!

I am very keen to see whether the Hadedas disappear over the next few days or whether they get used to my fake Falcon...

Link to comment
Share on other sites

Something basic but useful for my life. There are times where I want to get up around 3AM but the wife does not have any interest in that. I created a wake mode that turns my fan (there is a direct air outlet/fan on each side of the bed - wife didn't want a ceiling fan in that room) on and off until I wake up. This doesn't wake her up but the change in air flow multiple times will wake me up. The wake process will go on for around 5 minutes and is stopped when it detects motion in the master bathroom (where I first go when I get up). If it goes over 5 minutes without being stopped, it will send an announcement and toggle the lights in the room (where I don't sleep through it).  I have used it the last couple of morning and it worked great. 

Link to comment
Share on other sites

Today I (virtually) finished the setup of the cool Janus BMS driver (at my main residence, I did something similar but not as well at my Beach House some time back) which has allowed me to visualise all sorts of things (including pool, jacuzzi and chiller temperatures, underfloor heating and aircon modes and states as well as temperatures in all rooms, battery levels, power usage, voltage by phase, solar power, water usage etc.). A few sample screenshots below.

 

 

528CA866-915F-4230-B6CD-A1EC8B983D4D.png

 

4D9AFD6E-881D-489A-B4CD-2ECFFE81DEBE.png

D2BFE975-DD7E-4A42-819B-2E93D416631F.png

Link to comment
Share on other sites

Not truly automation, per se, but programmed the Caseta remotes on my wife's and my nightstands, which normally just control the Hue bulb for that nightstand, to be able to go into 'dual' mode.

Hold down the center button on the Caseta remote for 3 seconds and dual mode is triggered. Then instead of controlling just your nightstand, you're controlling both nightstands which are in sync. Your remote will stay in dual mode for 8 seconds after the last button press. Press a button at 6 seconds, the timer resets. After 8 seconds of no press in dual mode, your remote returns to single mode, controlling just your nightstand.

Link to comment
Share on other sites

  • 2 months later...

More control vs automate but I started to use Alexa to do voice control to show my security cameras for PiP display on a TV.  Using Video Storm Netplay TV + IFTTT Driver I can say "Alexa Trigger {Camera Name}" and on the TV I'll get a PiP pop up for 20 seconds showing the camera I called to Alexa.

When someone rings my doorbell that happens automatically, but sometimes we think we hear someone outside, maybe a package being dropped off, etc.  This way we can pull up the cameras whenever we want vs going into the C4 or Blue Iris app (assuming we are near a TV that is on).

Link to comment
Share on other sites

2 hours ago, eggzlot said:

More control vs automate but I started to use Alexa to do voice control to show my security cameras for PiP display on a TV.  Using Video Storm Netplay TV + IFTTT Driver I can say "Alexa Trigger {Camera Name}" and on the TV I'll get a PiP pop up for 20 seconds showing the camera I called to Alexa.

When someone rings my doorbell that happens automatically, but sometimes we think we hear someone outside, maybe a package being dropped off, etc.  This way we can pull up the cameras whenever we want vs going into the C4 or Blue Iris app (assuming we are near a TV that is on).

Why does the TV need to be on? Surely you can turn it on as part of the script?

I see that VideoStorm also has an Alexa driver.  I wonder if it would be faster than IFTTT?

Link to comment
Share on other sites

2 hours ago, South Africa C4 user said:

Why does the TV need to be on? Surely you can turn it on as part of the script?

I see that VideoStorm also has an Alexa driver.  I wonder if it would be faster than IFTTT?

I could turn it on as part of the script.  for now I kept it basic - two people live in the house with 6 Tvs.  80% of the time we watch TV together.  so my programming via IFTTT is simple Alexa Trigger {Camera Name}.  That sends the PiP request to all 6 TVs.  if they are on, it will show the PiP, if the TVs are off, nothing.  If I am by a TV that is not on, its just as easy to pull up my phone and look so why wait for the TV to turn on.  Also the PiP signal starts ASAP so I'd need even more logic - if TV is on send PiP request, if TV is off, turn on TV, wait 10 seconds, then send PiP request.

I could get more granular and do Alexa Trigger {Camera Name} in {Room Name} and only send the PiP request to that room.  but that seems like a mouthful, Alexa Trigger Front Door Camera in Living Room TV.  Then when it comes to our bedroom did we name it bedroom or master bedroom?  We have two offices so we'd need distinct names, etc.  So I kept it simple for now, see how often we use it, and tweak from there.  And if I went to the ability to turn on the TV and launch the PiP I'd have to go by room name otherwise I could ask to call up a camera because I am in my office and my wife can be in her office on a conf call and all the sudden the TV will turn on, etc.  Just would be odd.  This way it only appears on the TV if it is on.

Video Storm has 2 Alexa Skills - Netplay and SimpleC4 (via Splashtiles).  Since I had Alan's driver and used it before, it is what I used first.  Since they are cloud drivers not sure one would be faster though I guess Alan's hops from IFTTT to Pushover to C4 and maybe Netplay is Amazon direct to my system.  Maybe next week I'll mess with that driver to see the difference.

 

Link to comment
Share on other sites

Not really automating, but more programming.

I had to replace the springs on my Garage Door.  The old system last 18 years and 10's of thousands of use.  Door guy said the new springs would only last about 7 years or so.  He said it would pretty much fail after 10,000 operations.  Opening and Closing would count as two.  

So I made a script that would count how many operations the door has performed.  It emails me every time the door opens/closes and includes the open/close count.

I am going to see how accurate the door guy's guess was.... 😁

 

It has dawned one me, I may need a hobby 😂

 

Link to comment
Share on other sites

7 hours ago, Jeff W said:

Not really automating, but more programming.

I had to replace the springs on my Garage Door.  The old system last 18 years and 10's of thousands of use.  Door guy said the new springs would only last about 7 years or so.  He said it would pretty much fail after 10,000 operations.  Opening and Closing would count as two.  

So I made a script that would count how many operations the door has performed.  It emails me every time the door opens/closes and includes the open/close count.

I am going to see how accurate the door guy's guess was.... 😁

 

It has dawned one me, I may need a hobby 😂

 

Love it!
 

You may find 7,000 emails gets a bit much… I have a number of variable like this which I track.  Some I send messages on every 10th time the event happens (eg after my borehole pump turns on 10 times, 20 times etc. on the same day, I notify myself).  Others I simply report on (in bulk) once a week at midnight on a Friday.

Link to comment
Share on other sites

2 hours ago, wnpublic said:

Set up both a PurpleAir PM2.5 air quality sensor and an Ambient Weather Station AWS-2902.  Both are feeding data into my home automation system and firing automations, such as firing up indoor air filters plugged into cheap zwave plugs when the AQI tanks.

How does the data from your weather station get into C4?  I have an older Ambient Station that sends data to Wunderground, and I used to use the Wunderground driver but I am pretty sure that has been deprecated as Wunderground is now owned by IBM and they want to charge people $$$ to access the data.

Link to comment
Share on other sites

41 minutes ago, zaphod said:

How does the data from your weather station get into C4?  I have an older Ambient Station that sends data to Wunderground, and I used to use the Wunderground driver but I am pretty sure that has been deprecated as Wunderground is now owned by IBM and they want to charge people $$$ to access the data.

This is using Home Assistant.  But i'm pretty sure you could just pull the Ambient dashboard page into C4 using the generic web page driver.

Link to comment
Share on other sites

19 hours ago, zaphod said:

How does the data from your weather station get into C4?  I have an older Ambient Station that sends data to Wunderground, and I used to use the Wunderground driver but I am pretty sure that has been deprecated as Wunderground is now owned by IBM and they want to charge people $$$ to access the data.

I still have my account after IBM acquisition because my station still transmit data to WU, so as long as your are “suppling” my account still works!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...