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

Using JSON Payload Variables as Service Targets #162

Closed
egadgetjnr opened this issue Dec 10, 2015 · 2 comments
Closed

Using JSON Payload Variables as Service Targets #162

egadgetjnr opened this issue Dec 10, 2015 · 2 comments

Comments

@egadgetjnr
Copy link

Hey There,
I just had an idea, and I was wondering if you might be able to advise if it's possible and maybe offer a possible feature in a future release.

I'm currently experimenting with the Prowl service, and I have an idea around pointing to dynamic targets.

The payload is JSON in the following format:
{ "SystemID" : "V1_001", "AlarmType" : "TempHigh", "AlarmDetails" : "Temp is 102" }

My Prowl Config is:

[config:prowl]
targets = {
'V1_001' : ['xxx', 'Alarm'],
'V1_002' : ['xx2', 'Alarm']
}

What I'm wanting to do, is have the topic section similar to the following where it allows the SystemID Variable to be used for the target instead of having to create separate topic sections just to change the target

[ProwlAlarm]
topic = 1/+/Alarm
targets = prowl:{SystemID}
title = {AlarmType}
priority = 2
format = {AlarmDetails}

Is there maybe another way I can approach this, or are you able to possibly assist?

Thanks heaps

@jpmens
Copy link
Collaborator

jpmens commented Dec 10, 2015

That is currently not possible: it would mean having to get the JSON payload and react on that. I have thought about that previously, but it's not implemented.

What you might try is to model after the targets dictionary. Please look at the README, starting at where it says Targets can be also defined as a dictionary

@amotl
Copy link
Member

amotl commented Jan 29, 2024

Hi. Apologies for the very late reply. I think this feature has now been implemented on behalf of Templated targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants