Panstamp Integration

Begonnen von youngengineer, 17 September 2014, 07:37:09

Vorheriges Thema - Nächstes Thema

youngengineer

#15
I've just reinstalled FHEM after receiving a new B+ raspberry PI model.

I am using the new arduino 1.58 IDE.

There seems to be a bug where devices are not identified. CLI is always reporting SWAP unknown device. Even using the stock sketches like binups.

Sometimes however the readings will be populated, but most of the time not its random. Also for custom sketches on the GUI the info such as module name and manufacturer ID will never be shown unless readDeviceXML is manually set.

The device XML files have been uploaded as they always have before and still no luck.

Strange thing is even if I use binups sketch for example it will always miss the last PWM output number 4 but however a previously compiled panstamp on the old IDE will always show all the endpoints.


Hmm Any ideas?

youngengineer

Zitat von: youngengineer am 05 Oktober 2014, 22:11:50
I've just reinstalled FHEM after receiving a new B+ raspberry PI model.

I am using the new arduino 1.58 IDE.

There seems to be a bug where devices are not identified. CLI is always reporting SWAP unknown device. Even using the stock sketches like binups.

Sometimes however the readings will be populated, but most of the time not its random. Also for custom sketches on the GUI the info such as module name and manufacturer ID will never be shown unless readDeviceXML is manually set.

The device XML files have been uploaded as they always have before and still no luck.

Strange thing is even if I use binups sketch for example it will always miss the last PWM output number 4 but however a previously compiled panstamp on the old IDE will always show all the endpoints.

The last image is of the panStamp compiled with the old IDE which shows all 4 PWM endpoints.

I am using the latest FHEM beta install with XML::SIMPLE and all required modules.


Hmm Any ideas?

justme1968

if the old ide did work then the problem is most likely with the new ide. i know of many problems with different ide versions. not only with the panstamps but also with some other arduino based projects.

for a custom sketch you have to use the correct initialization order on startup including the sending of the product code from setup().
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

youngengineer

The custom sketch works fine with Lagarto so I am almost sure this is some incompatibility with FHEM and the new 1.5 panStamp libarys and/or 1.5 IDE! I guess I better go back convert my sketch to work with the 1.0 IDE.

justme1968

you did not say you were using the new panstamp libs.

i have not tried them till now as i'm using a modified version of an older release myself as i had to make some modifications to get the panstamp lib working together with other api devices besides the cc1101.

i'm not sure daniel sees the 1.5 libs ready for production environments. i will try to check bit this will take some time.

if there are no features of the 1.5 lib you need it would be better at the moment to stay with the older version.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

youngengineer

Hi Andre. I actually got it working correctly after erasing the eeprom on one of my panstamps. eepromToFactoryDefaults()

I bumped into a post coincidentally about the changes to the SWAP stack and how using the new libarys could cause issues on panStamps which were previously flashed to use the older libs.

Strange how my sketch worked on Lagarto and not Fhem though, hmm, all working so far now anyway so sorry to raise the alert.

I'm at a point with Fhem now where I have allot of the functionality which I need which is fantastic. So will be making a short writing soon.

I am still very interested in getting the on-for-timer function working with panStamps, to turn on my LED modules when my PIR is triggered. Right now it will turn on the light however the timer element does not seem to be active. Is this something that must be customized in the helper module you provided me with? Or is it a general FHEM feature?


justme1968

on-for-timer should 'just work' if on and off work.

please try call on-for-timer for a short time manualy: set <device> on-for-timer 10

what happens?
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

youngengineer

#22
As you say it does " Just Work". I did try just a few days ago and could not get it to work, the lights would turn on but not off even when using a 1 second timer.

I have been getting some very strange behavior with FHEM in the past few days. I have tried multiple re-installs which have all ended up with similar errors. I am using the Raspberry PI B+ with a 2A PSU and class 10 SD card. The latest update of FHEM or the readingsProxy module seems to have issues. I have attached a few of the error messages in pictures below. The second picture is of the errors after performing a global update in fhem to the very latest update of today which seems to come from readindingsProxy.

The first picture are of errors on a previous version of FHEM updated to the latest FHEM release only a few weeks ago. There will generally be many pages of these errors that will flood the screen.

Any help appreciated!


youngengineer

#23
** Update

I fixed the issue on the first picture in relation to "SysRq : HELP : loglevel(0-9) reBoot Crash"

It was due to me re-installing XML::SAX due to a missing file error. After re-installing XML::SAX, the UART would be reassigned to the OS. The fix was to remove, console=ttyAMA0,115200 from /boot/cmdline.txt and comment out T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 from /etc/inittab.

Anyway, the other errors remain however they don't seem to be causing issues with FHEM that I know of.

I do have anotherquestion however!

I am currently using a timer to turn all lights on at sunset, then another timer to dim all lights to 50% at 11pm, notify is then used with my PIR to trigger an event to turn all lights on to 100% for 20 minutes using a on-for-timer which is currently all working fine. However after the timer finishes, all lights will turn off, is there a way to return then lights to the previous state or 50% dim?

Thanks again!

justme1968

for the readingsProxy error message: i will have a look.

for the on-for-timer not working: lease connect Byte telnet to fhem ans enter

  inform timer
  on <device>
  off <device>
  on-for-timer <device> 5

ans then post the complete output.

for the timers: in the two tjmers in addition to swirching the lights you have to write the desired level to an additional reading in the device. this is done with setreading. in the pir notify you would then not use on-for-timer but just on ans deine an temporary at that will switch the lights back to the stored desired level.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

justme1968

the line numbers from the error message don't match the current readingsProxy version.

what does versionversion readingsProxyreturn? it should be# $Id: 33_readingsProxy.pm 5750 2014-05-05 09:26:45Z justme1968 $
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

youngengineer

#26
Hi Andre. Sorry but my previous post I meant to say that on-for-timer is now working! But before it was not.

The output for readingsproxy is # $Id: 33_readingsProxy.pm 5750 2014-05-05 09:26:45Z justme1968 $


As for the timer I am not quite sure I fully understand. When you say I have to write the desired level to an additional reading using setreading, is that defined on the lights or on the timers?

Is what your saying that I should use notify to turn on the lights then turn them back to their dimmed value afterwards such as. Essentially two different timers running at the same time?

define pirTimer notify SWAP_52:0D.* set AllLights on
define pirTimer2 at +00:00:20 set AllLights dim 50

Not sure if that makes sense. But how would notify trigger the second timer?

I think I may be confused.






justme1968

ok. i was confused as on-for-timer should have worked :)

you would put the reading into each device that is swithced on.

the temporary at would be defined during the execution of the notify. something like this:define pirTimer notify SWAP_52:0D.* set AllLights on; define pirTimer2 at +00:00:20 set AllLights dim 50

if you are sure that you will always go back to 50% that would be all. and you don't even need the setreading mentioned above.

if you want to be sure to catch also vor example a pir going off 10 minutes  before the light is switched off then the code would be something like this:define pirTimer notify SWAP_52:0D.* { fhem(set AllLights on); my $desired = ReadingsVal("AllLights", "myDesired","0"); fhem( "define pirTimer2 at +00:00:20 set AllLights dim $desired");}

and the timer would set the myDesired reading to 0 and 50 respectively in addition to switching the lights on and of.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

youngengineer

#28
I did not know you could use ; to merge commands in one definition, very nice!

The first example does work, but its inconsistent. It will always run the first part  define pirTimer notify SWAP_52:0D.* set AllLights on; turning lights on, but the second timer part define pirTimer2 at +00:00:20 set AllLights dim 50 it seems to not always work. I would say 50-50 so there is certainly some issue there. I have experimented with different time settings and dim/on/off values with similar results.


The second command I'm not sure how it works, but If used as provided it will through an error as it will look for my as a module and error unknown command my, so I am guessing I need to replace it with a device or endpoint?

To add to the confusion I have some other complexities, I need to have the pir notify enabled only at 11pm otherwise the pir will be bringing the lights up to 100% and then back to 50% before 11pm. The lights need to be at 100% until 11pm then switch to 50% throughout the night until the morning timer turns them off,  or when the PIR is triggered between that time. I think a way around this would be to have the lights revert to their last setting, so that if the pir is triggered before 11pm then they will revert back to 100% which would be their current setting. That is however a Microsoft solution, it would be better to have a setting which activates notify PIR at a certain time.

Its now 5am here so the brain is starting to slow down.

Damn, I have so many questions, I will have to send you a paypal donation at some point for all your help.

youngengineer

#29
Just another update Andre. I managed to get the first command to work consistantly.

The trick was to use a double ;; between the commands.

so  define motionSensor notify SWAP_52:0D.* set myLight3 dim 100;; define pirTimer2 at +00:00:20 set myLight3 dim 30

Seems like when only using a single ; the timer would not return the light back to a dimmed value, it would sometimes stay at the first value 100.