Skip to content

Is it possible to pass the location coordinates as a payload to dynamically change the location? #92

Description

@an-xxxx

I'm trying to change the location for sunrise and sunset events depending on the user's location. I've tried setting the latitude and longitude to empty values but the sunrise and sunset event is being based on UTC so now I'm trying to pass the latitude and longitude values inside the payload but it is not working on my end.

Here's a snippet of my function node with the input payload for the schedex node with a latitude and longitude included for a country on UTC+8:

const ontime = 'sunsetStart'
const offtime = 'sunset'

const onpayload = 'The sun is starting to set'

const offpayload = 'The sun has set'

const onoffset = 0
const offoffset = 0

const day_selected = {
    mon: true,
    tue: true,
    wed: true,
    thu: true,
    fri: true,
    sat: true,
    sun: true
}

const latitude = 12.8797207
const longitude = 121.7740173

const schedex_input = {
    ontime, 
    offtime, 
    onpayload, 
    offpayload,
    onoffset,
    offoffset,
    day_selected,
    latitude,
    longitude
}

msg.payload = schedex_input

return msg;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions