Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get History Node #183

Closed
sti0 opened this issue Jan 4, 2020 · 0 comments
Closed

Get History Node #183

sti0 opened this issue Jan 4, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@sti0
Copy link

sti0 commented Jan 4, 2020

Describe the bug
If I set a start and end time and then switching to relative time the start time is actual time - x but end time ist still the previous set time. This leads to false results.

To Reproduce
Steps to reproduce the behavior:

  1. Insert a HA history node
  2. Select a entity of your choice (I did a binary sensor)
  3. Insert start date e.g. 2020-01-04T08:00:00+01:00
  4. Insert end date e.g. 2020-01-04T09:00:00+01:00
  5. Inject the flow and watch the output. You get the history between 8 and 9 am.
  6. Edit the node and check the "Use Relative Time" flag
  7. Insert a time e.g. 30m

Expected behavior
I expect to get the last 30m if I use relative time.

Screenshots
If I use fixed times:
image
If I use a relative time afterwards:
image
=> enddate should be empty

Example Flow
If applicable, add an example of exported json of a flow exhibiting the issue to aid in reproduction.
[{"id":"a26bd4e2.bed248","type":"inject","z":"d521bfbc.693d2","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":440,"y":160,"wires":[["1fb52ed2.df46d1"]]},{"id":"1fb52ed2.df46d1","type":"api-get-history","z":"d521bfbc.693d2","name":"get history","server":"4d2776f1.5d8f58","startdate":"2020-01-04T08:00:00+01:00","enddate":"2020-01-04T09:00:00+01:00","entityid":"binary_sensor.wsr_buro_contact","entityidtype":"is","useRelativeTime":true,"relativeTime":"30m","flatten":true,"output_type":"array","output_location_type":"msg","output_location":"payload","x":630,"y":160,"wires":[["d0c316da.6aa0e8"]]},{"id":"d0c316da.6aa0e8","type":"debug","z":"d521bfbc.693d2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":220,"wires":[]},{"id":"4d2776f1.5d8f58","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Environment (please complete the following information):

  • Node Red Version: v1.0.3
  • Node.js Version: ??
  • NR Home Assistant Plugin Version: v.5.0.7
  • Is Node Red running in Docker: hassio

Other (please complete the following information):

  • Have you searched previous issues for duplicates?: yes

Additional context
Add any other context about the problem here.

@zachowj zachowj added the bug Something isn't working label Jan 4, 2020
@zachowj zachowj closed this as completed in d536c3c Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants