Jeenode + roomboard: switching output from Homeseer
Moderator: Mdamen
Jeenode + roomboard: switching output from Homeseer
I got the Jeenode and the roomboard working for a while now.
In the sketch there is also a LED defined.
It switches on when a movement is detected from the PIR.
In the Homeseer "plugin" there are buttons aside the device which could indicate that it is possible to switch the LED on/off...
In the sketch there is a decision rule which switches the LED on/off.
How do i have to adjust the sketch to switch the LED on/off using the Homeseer Plugin???
In the sketch there is also a LED defined.
It switches on when a movement is detected from the PIR.
In the Homeseer "plugin" there are buttons aside the device which could indicate that it is possible to switch the LED on/off...
In the sketch there is a decision rule which switches the LED on/off.
How do i have to adjust the sketch to switch the LED on/off using the Homeseer Plugin???
Re: Jeenode + roomboard: switching output from Homeseer
So you managed to uncomment the LED definition code so that it shows up in Homeseer. GreatIn the sketch there is also a LED defined.
It switches on when a movement is detected from the PIR.
When you use the Buttons, HomeSeer sends a message to the JeeNode which triggers the execution of the overRuleMessage() in the JeeNode sketch.
There the status of the device is set and overruled so that Decisionrules will no longer influence the device status.
The next step you have to take is to modify the hard coded switching of the LED in the sketch, which is at lines 722-726.
As you can see this is too hard coded as it is right now; I left it in as it was, since this is a good exercise
Just try it and report back if you're running into problems.
Re: Jeenode + roomboard: switching output from Homeseer
i think that i have another sketch.... on line 709 to 731 it says:
void loop() {
#if SERIAL || DEBUG
Serial.print('#');
delay(2);
#endif
#if PIR_PORT
if (pir.triggered()) {
payload.moved = pir.state();
#if SERIAL || DEBUG
delay(2); // without this delay, reception is garbage...
Serial.print("PIR "); Serial.println((int)payload.moved);
delay(2);
#endif
// update the devices and report to Homeseer.
updateSystem();
doReport(); // !!! kan dit niet vanuit updatesystem?
}
Also i cannot find the overRuleMessage() in my sketch...
(I am using "JeeNode for Homeseer Low Power")
void loop() {
#if SERIAL || DEBUG
Serial.print('#');
delay(2);
#endif
#if PIR_PORT
if (pir.triggered()) {
payload.moved = pir.state();
#if SERIAL || DEBUG
delay(2); // without this delay, reception is garbage...
Serial.print("PIR "); Serial.println((int)payload.moved);
delay(2);
#endif
// update the devices and report to Homeseer.
updateSystem();
doReport(); // !!! kan dit niet vanuit updatesystem?
}
Also i cannot find the overRuleMessage() in my sketch...
(I am using "JeeNode for Homeseer Low Power")
Re: Jeenode + roomboard: switching output from Homeseer
That's right, wrong sketch.
This version doesn't support controlling the LED at all.
PS.
Why? Because it's low power, which means almost always off, so it cannot receive messages.
This version doesn't support controlling the LED at all.
PS.
Why? Because it's low power, which means almost always off, so it cannot receive messages.
Re: Jeenode + roomboard: switching output from Homeseer
I followed the handout allready...., but used the low power variant...
Should it also be visible in the homeseer log? (when switching the led within Homeseer....)
I tried using the "normal" variant, but was not able (jet) to get it working
Should it also be visible in the homeseer log? (when switching the led within Homeseer....)
I tried using the "normal" variant, but was not able (jet) to get it working
Re: Jeenode + roomboard: switching output from Homeseer
In the log yes, not in the LED status.
It should not be, cause the only thing Homeseer does is send the overrule message to the JeeNode, it doesn't "locally" adjust the LED status by itself.
Only when a status update is coming from the JeeNode, the LED is updated.
It should not be, cause the only thing Homeseer does is send the overrule message to the JeeNode, it doesn't "locally" adjust the LED status by itself.
Only when a status update is coming from the JeeNode, the LED is updated.
Re: Jeenode + roomboard: switching output from Homeseer
Wrong!, switching the LED will not appear in the log. I checked it.
This can easily be changed by adding a hs.writelog() in the subs onMEssage() and offMessage, around line 333 in the jeeNode.txt script.
This can easily be changed by adding a hs.writelog() in the subs onMEssage() and offMessage, around line 333 in the jeeNode.txt script.
Re: Jeenode + roomboard: switching output from Homeseer
not having any success here for now.....
Is there a basic sketch somewhere where i can start from?
ie just switching one led on/off
Is there a basic sketch somewhere where i can start from?
ie just switching one led on/off
Re: Jeenode + roomboard: switching output from Homeseer
Yes, the sketch that is used in the handout.
There's a LED device in the sketch, but it's commented out.
With a few adjustments this sketch can be used with a LED, since it's not low power it will be able to receive messages from Homeseer.
Just try it. If you think you can't manage that, I will see if I can create a "LED-only" version for you later this evening.
Including notes about what I changed, so that next time you can try yourself with a relay or whatever you want.
There's a LED device in the sketch, but it's commented out.
With a few adjustments this sketch can be used with a LED, since it's not low power it will be able to receive messages from Homeseer.
Just try it. If you think you can't manage that, I will see if I can create a "LED-only" version for you later this evening.
Including notes about what I changed, so that next time you can try yourself with a relay or whatever you want.
Re: Jeenode + roomboard: switching output from Homeseer
I made a sketch for switching one LED on/off.
I stripped the original sketch but left in all the handy stuff like the messaging etc. and all other stuff you need to be able to communicate with HS.
Remember to delete all the (non-JeeLink) devices in Homeseer before you start the sketch; devices will be recreated automatically once the JeeNode "boots" with the new sketch running
Hey, and it's 2-way of course, ain't that neat
I stripped the original sketch but left in all the handy stuff like the messaging etc. and all other stuff you need to be able to communicate with HS.
Remember to delete all the (non-JeeLink) devices in Homeseer before you start the sketch; devices will be recreated automatically once the JeeNode "boots" with the new sketch running
Hey, and it's 2-way of course, ain't that neat
Re: Jeenode + roomboard: switching output from Homeseer
Thanks!!!
I will try it tomorow!!!
I will try it tomorow!!!
Re: Jeenode + roomboard: switching output from Homeseer
Hello,
I have tried the sketch the led is working great with the status buttons
But when I make an event the led status is changing within Homeseer to on
But the led is not going on.
When I press the on button then the led is going on.
Do you have also an example for a sketch with an input and a output
Thanks
Ed
I have tried the sketch the led is working great with the status buttons
But when I make an event the led status is changing within Homeseer to on
But the led is not going on.
When I press the on button then the led is going on.
Do you have also an example for a sketch with an input and a output
Thanks
Ed
Re: Jeenode + roomboard: switching output from Homeseer
What you are doing is probably setting the LED value from the event? I don't think that will work.
The LED buttons are created like this (On button as example):
Explanation: what happens is that when you click the LED "On" button, the onMessage() routine in the JeeNode.txt script is executed with the devicecode as parameter.
If you're able to the same from your event, then it should work from an event also.
OK, I gave HS Events a try, here's an LED ON action that works for me (my LED's HSCode is ^8):
The LED buttons are created like this (On button as example):
Code: Select all
hs.DeviceButtonAdd hc&dv.dc,"jeeNode.txt(""onMessage"","""& dv.dc & """)","On"
If you're able to the same from your event, then it should work from an event also.
OK, I gave HS Events a try, here's an LED ON action that works for me (my LED's HSCode is ^8):
Re: Jeenode + roomboard: switching output from Homeseer
PS Ed,
Do you mean Analog/Digital Input/Output?
Do you mean Analog/Digital Input/Output?
Re: Jeenode + roomboard: switching output from Homeseer
Hello,
Yes that’s what I am doing
Device Command: nodeId: 1 LED1 Value Set set to On
I can only make a choice between value set on or off
I will try your example when I come home
Ed
Yes that’s what I am doing
Device Command: nodeId: 1 LED1 Value Set set to On
I can only make a choice between value set on or off
I will try your example when I come home
Ed