Tageszeit in global speichern bzw ausgeben.

Node-RED als CCU3/RaspberryMatic Addon, WebApp, HomeKit, ...

Moderator: Co-Administratoren

Antworten
sanmar
Beiträge: 65
Registriert: 29.01.2018, 11:22

Tageszeit in global speichern bzw ausgeben.

Beitrag von sanmar » 17.04.2019, 13:55

Hi,

versuche mit dem Timenodes, die Tageszeit zu speichern, anzuzeigen und so in anderen Nodes nutzen zu können

wann erfolgt den der inject? scheint erst die variable zusetzen wenn ich es manuell klicke. nach restart klappt das auch nicht ?

danke schonmal

Code: Alles auswählen

[{"id":"80c2554a.047558","type":"time-inject","z":"427fc89b.e34038","name":"","positionConfig":"af025582.be0608","payload":"Sonnenaufgang","payloadType":"str","payloadTimeFormat":"0","payloadOffset":"","payloadOffsetType":"none","payloadOffsetMultiplier":60000,"topic":"","time":"sunrise","timeType":"pdsTime","timeDays":"*","offset":"","offsetType":"none","offsetMultiplier":60000,"property":"","propertyType":"none","timeAlt":"","timeAltType":"entered","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":"","addPayload1":"","addPayload1Type":"none","addPayload1Value":"","addPayload1ValueType":"date","addPayload1Format":"0","addPayload1Offset":"","addPayload1OffsetType":"none","addPayload1OffsetMultiplier":60000,"addPayload1Days":"*","addPayload2":"","addPayload2Type":"none","addPayload2Value":"","addPayload2ValueType":"date","addPayload2Format":"0","addPayload2Offset":"","addPayload2OffsetType":"none","addPayload2OffsetMultiplier":60000,"addPayload2Days":"*","addPayload3":"","addPayload3Type":"none","addPayload3Value":"","addPayload3ValueType":"date","addPayload3Format":"0","addPayload3Offset":"","addPayload3OffsetType":"none","addPayload3OffsetMultiplier":60000,"addPayload3Days":"*","recalcTime":"","x":240,"y":540,"wires":[["d6de9d9a.fa7fc"]]},{"id":"d6de9d9a.fa7fc","type":"change","z":"427fc89b.e34038","name":"Persist as global.dayPeriod","rules":[{"t":"set","p":"dayPeriod","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":620,"wires":[["81f14436.2f5cb8","739cdc49.e62d34"]]},{"id":"1d5cfe97.62ddf1","type":"time-inject","z":"427fc89b.e34038","name":"","positionConfig":"af025582.be0608","payload":"Tag","payloadType":"str","payloadTimeFormat":"0","payloadOffset":"","payloadOffsetType":"none","payloadOffsetMultiplier":60000,"topic":"","time":"sunriseEnd","timeType":"pdsTime","timeDays":"*","offset":0,"offsetType":"none","offsetMultiplier":60000,"property":"","propertyType":"none","timeAlt":"","timeAltType":"entered","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":"","addPayload1":"","addPayload1Type":"none","addPayload1Value":"","addPayload1ValueType":"date","addPayload1Format":"0","addPayload1Offset":"","addPayload1OffsetType":"none","addPayload1OffsetMultiplier":60000,"addPayload1Days":"*","addPayload2":"","addPayload2Type":"none","addPayload2Value":"","addPayload2ValueType":"date","addPayload2Format":"0","addPayload2Offset":"","addPayload2OffsetType":"none","addPayload2OffsetMultiplier":60000,"addPayload2Days":"*","addPayload3":"","addPayload3Type":"none","addPayload3Value":"","addPayload3ValueType":"date","addPayload3Format":"0","addPayload3Offset":"","addPayload3OffsetType":"none","addPayload3OffsetMultiplier":60000,"addPayload3Days":"*","recalcTime":"","x":220,"y":600,"wires":[["d6de9d9a.fa7fc"]]},{"id":"2327d9d2.289656","type":"time-inject","z":"427fc89b.e34038","name":"","positionConfig":"af025582.be0608","payload":"Sonnenuntergang","payloadType":"str","payloadTimeFormat":"0","payloadOffset":"","payloadOffsetType":"none","payloadOffsetMultiplier":60000,"topic":"","time":"sunset","timeType":"pdsTime","timeDays":"*","offset":0,"offsetType":"none","offsetMultiplier":60000,"property":"","propertyType":"none","timeAlt":"","timeAltType":"entered","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":"","addPayload1":"","addPayload1Type":"none","addPayload1Value":"","addPayload1ValueType":"date","addPayload1Format":"0","addPayload1Offset":"","addPayload1OffsetType":"none","addPayload1OffsetMultiplier":60000,"addPayload1Days":"*","addPayload2":"","addPayload2Type":"none","addPayload2Value":"","addPayload2ValueType":"date","addPayload2Format":"0","addPayload2Offset":"","addPayload2OffsetType":"none","addPayload2OffsetMultiplier":60000,"addPayload2Days":"*","addPayload3":"","addPayload3Type":"none","addPayload3Value":"","addPayload3ValueType":"date","addPayload3Format":"0","addPayload3Offset":"","addPayload3OffsetType":"none","addPayload3OffsetMultiplier":60000,"addPayload3Days":"*","recalcTime":"","x":250,"y":660,"wires":[["d6de9d9a.fa7fc"]]},{"id":"fb479d8a.7e045","type":"time-inject","z":"427fc89b.e34038","name":"","positionConfig":"af025582.be0608","payload":"Morgendämmerung","payloadType":"str","payloadTimeFormat":"0","payloadOffset":"","payloadOffsetType":"none","payloadOffsetMultiplier":60000,"topic":"","time":"astronomicalDawn","timeType":"pdsTime","timeDays":"*","offset":0,"offsetType":"none","offsetMultiplier":60000,"property":"","propertyType":"none","timeAlt":"","timeAltType":"entered","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":"","addPayload1":"","addPayload1Type":"none","addPayload1Value":"","addPayload1ValueType":"date","addPayload1Format":"0","addPayload1Offset":"","addPayload1OffsetType":"none","addPayload1OffsetMultiplier":60000,"addPayload1Days":"*","addPayload2":"","addPayload2Type":"none","addPayload2Value":"","addPayload2ValueType":"date","addPayload2Format":"0","addPayload2Offset":"","addPayload2OffsetType":"none","addPayload2OffsetMultiplier":60000,"addPayload2Days":"*","addPayload3":"","addPayload3Type":"none","addPayload3Value":"","addPayload3ValueType":"date","addPayload3Format":"0","addPayload3Offset":"","addPayload3OffsetType":"none","addPayload3OffsetMultiplier":60000,"addPayload3Days":"*","recalcTime":"","x":280,"y":480,"wires":[["d6de9d9a.fa7fc"]]},{"id":"e50ff47a.faa858","type":"time-inject","z":"427fc89b.e34038","name":"","positionConfig":"af025582.be0608","payload":"Abenddämmerung","payloadType":"str","payloadTimeFormat":"0","payloadOffset":"","payloadOffsetType":"none","payloadOffsetMultiplier":60000,"topic":"","time":"astronomicalDawn","timeType":"pdsTime","timeDays":"*","offset":0,"offsetType":"none","offsetMultiplier":60000,"property":"","propertyType":"none","timeAlt":"","timeAltType":"entered","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":"","addPayload1":"","addPayload1Type":"none","addPayload1Value":"","addPayload1ValueType":"date","addPayload1Format":"0","addPayload1Offset":"","addPayload1OffsetType":"none","addPayload1OffsetMultiplier":60000,"addPayload1Days":"*","addPayload2":"","addPayload2Type":"none","addPayload2Value":"","addPayload2ValueType":"date","addPayload2Format":"0","addPayload2Offset":"","addPayload2OffsetType":"none","addPayload2OffsetMultiplier":60000,"addPayload2Days":"*","addPayload3":"","addPayload3Type":"none","addPayload3Value":"","addPayload3ValueType":"date","addPayload3Format":"0","addPayload3Offset":"","addPayload3OffsetType":"none","addPayload3OffsetMultiplier":60000,"addPayload3Days":"*","recalcTime":"","x":270,"y":720,"wires":[["d6de9d9a.fa7fc"]]},{"id":"7e265ac1.5e51f4","type":"time-inject","z":"427fc89b.e34038","name":"","positionConfig":"af025582.be0608","payload":"Nacht","payloadType":"str","payloadTimeFormat":"0","payloadOffset":"","payloadOffsetType":"none","payloadOffsetMultiplier":60000,"topic":"","time":"astronomicalDawn","timeType":"pdsTime","timeDays":"*","offset":0,"offsetType":"none","offsetMultiplier":60000,"property":"","propertyType":"none","timeAlt":"","timeAltType":"entered","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":"","addPayload1":"","addPayload1Type":"none","addPayload1Value":"","addPayload1ValueType":"date","addPayload1Format":"0","addPayload1Offset":"","addPayload1OffsetType":"none","addPayload1OffsetMultiplier":60000,"addPayload1Days":"*","addPayload2":"","addPayload2Type":"none","addPayload2Value":"","addPayload2ValueType":"date","addPayload2Format":"0","addPayload2Offset":"","addPayload2OffsetType":"none","addPayload2OffsetMultiplier":60000,"addPayload2Days":"*","addPayload3":"","addPayload3Type":"none","addPayload3Value":"","addPayload3ValueType":"date","addPayload3Format":"0","addPayload3Offset":"","addPayload3OffsetType":"none","addPayload3OffsetMultiplier":60000,"addPayload3Days":"*","recalcTime":"","x":250,"y":780,"wires":[["d6de9d9a.fa7fc"]]},{"id":"81f14436.2f5cb8","type":"link out","z":"427fc89b.e34038","name":"TagPeriod","links":[],"x":835,"y":620,"wires":[]},{"id":"739cdc49.e62d34","type":"ui_text","z":"427fc89b.e34038","group":"357e4bfe.adbb94","order":8,"width":0,"height":0,"name":"","label":"Tageszeit","format":"{{global.dayPeriod}}","layout":"row-spread","x":880,"y":560,"wires":[]},{"id":"af025582.be0608","type":"position-config","z":"","name":"Home","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timezoneOffset":"2"},{"id":"357e4bfe.adbb94","type":"ui_group","z":"","name":"Misc","tab":"83fb1f35.f2bf1","order":4,"disp":true,"width":"4","collapse":false},{"id":"83fb1f35.f2bf1","type":"ui_tab","z":"","name":"Dashboard","icon":"fa-home","order":1,"disabled":false,"hidden":false}]

Hypnos
Beiträge: 179
Registriert: 06.01.2018, 12:48

Re: Tageszeit in global speichern bzw ausgeben.

Beitrag von Hypnos » 19.04.2019, 23:46

Hallo,

der Inject erfolgt entweder wenn man den Button betätigt oder jeweils genau zu dem Zeitpunkt, der unter dem Node steht:
Screenshot 2019-04-19 at 23.44.11.png
Bzw in deinem Fall dann:
Screenshot 2019-04-19 at 23.38.43.png
Wenn der Zeitpunkt vorbei ist, dann erst zum nächsten Zeitpunkt. Also wenn man beispielsweise gerade währenddessen das System neu startet.

Eine alternative, wäre das mit den Within-Time nodes und einem Inject der aller x Minuten getriggert wird:
Screenshot 2019-04-19 at 23.41.28.png
Gruß

sanmar
Beiträge: 65
Registriert: 29.01.2018, 11:22

Re: Tageszeit in global speichern bzw ausgeben.

Beitrag von sanmar » 20.04.2019, 16:54

@Hypnos

Danke dir :-)

Antworten

Zurück zu „RedMatic“