Panstamp Integration

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

Vorheriges Thema - Nächstes Thema

youngengineer

Hello, all.

I have some questions regarding panStamp and FHEM.

I have successfully added two panStamps to FHEM and can set register endpoints manually using the regSet command. However past this I am lost.

I would like like to add the individual endpoint registers to a switch on the GUI and bind them to groups as shown on the documentation however I have had little success.

Any help very much appreciated.

justme1968

you can define a swap device for a specific endpoint but the better and more flexible approach ist to use a readingsProxy dir wach endpoint you want to apear as a dedicated switch in the ui.

have a look in the forum ans the wiki for examples. most of fhem are for 1-wire of enocean devices but the concept is the same.

if you are using binout it iss best to use the version with one register per output. not the version that combined multiple outputs to a single register.

best regards
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

youngengineer

Thanks Andre.

I am currently looking through the 10_EnOcean module in an attempt to figure out how the dimming functionality could be ported over to panStamp.

I've made some progress but not found a complete solution yet!

justme1968

ich will show you a solution based in readingsProxy. looking in other modules will probably not really be helpfull.

  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

youngengineer

Thank you! I will let you know if I make any progress on my end, but I highly doubt it. Its mostly trail and error on my end. Mostly error.

justme1968

i have just send you a complete example with on off and dim commands.

if you have it working it would be nice if you could write a complete summary.

  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

youngengineer

That's very kind of you Andre!

I will test and get back to you with the results. Once I confirm everything is working I will make a complete write-up in English of the steps to get started with FHEM. I'm sure it would be of great help to new users like myself who have no idea where to start.







youngengineer

#7
Andre. Thanks for the help. The script you sent me is working well! But as always I have more questions!

My next question is in regards to creating a macro for editing parameters directly from the GUI.

Say I have a setting which I normally define directly in the config such as defining the location, for example attr global latitude x.xxxx attr global longitude x.xxxx which is also directly editable in the Global settings tab in the GUI. Would it be possible to create a shortcut/macro to edit the specific attribute directly in the GUI, in the same way that you can use readingsProxy assign a devices endpoint register to a room/group?

My end goal is to have a settings tab in the GUI with the most commonly changed/updated settings presented a clean and organized manner to make configuration easier!


justme1968

currently attributes have to be edited in the device detail view.

actually i'm thinking of extending readingsGroup to attributes also. but i have to think some more about it.

  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

youngengineer

It would be very useful. Well for me anyway, I guess you must figure out if there is a demand for such functionality in the community, but I could certainly see it as a very desirable feature. It would provide a very customizable webGUI to users wanting to have more control over the interface.

Btw, do you know if encryption was ported over to FHEM?




justme1968

have a look in the swap thread. i have implemented a beta version for the encryption and there is some feedback that it basically works. i would have to complete it and fix some corner cases.

the main problem with the swap encryption is that it is not possible to verify i the encryption with the given key is valid. that means if you receive a message and have configured the wrong key you can end up with a 'random' message that will not do what you want.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

youngengineer

I will have a look and let you know how it goes. I'm now having a look at graphing using SVG. I have created a log of the PWM register outputs and created a graph. The log is being populated and so is the graph however, I have noticed that the graph will always stay at 0. I know that the max PWM value is FF as it is in HEX so I think the graphing module does not know how to deal with HEX values. Do I have to convert it back to decimal for SVG to be able to handle the value?

justme1968

yes. you have to convert the values from hex to dec.

if you are using filelog you have to use something like hex($fld[2]) in the devspec line and for dblog $val=hex($val). the 2 hast probably changed to 3.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

youngengineer

So this modification must be done on the logging side rather then the graphing side. Ok.

I am using filelog, does this look right for the definition?

define Log.PWM FileLog log/test.log SWAP_6C:16.*|hex:($fld[2])


I guess what I will need to do to get the graphing how I want it will be to convert the value to decimal, then divide the value by 2.55 to give a 0-100, then invert the value as the load at 0 would be full power and 255 would be off which otherwise would create some very strange graphing.

justme1968

no. this hast to be done in the gplot file. i.e the SVG editor. not in the filelog definition.

the other way of doing this is to add a user reading to convert the hex values to decimal. and log only this user reading.

the scaling to a 0-100 range can be done in both aproaches. also the inversion.

or you can just chance the labeling on the axes so it matches your values.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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