- Platform information: Raspberry Pi Nano
- Hardware: Raspberry Pi Nano
- OS: Rasbian image from openHABian
- Java Runtime Environment:Zulu Embedded OpenJDK Java 8
- openHAB version: 2
- Issue of the topic: I want to retrieve the names of our Airbnb guest from an internal website.
When I use the view-source for the page, I see the text I’m looking for:
…<B>Greetings Simona and Tiziana ,<…
What I want is to get the names that are between the word “Greetings” and the coma. I think I just need to write a transform like I use for my Phillips Hue sensors:
(function(i) {
var json = JSON.parse(i);
return (json['config']['tholddark']);
})(input)
The above code extracts the value “9604” from the Hue Clip API text:
“config”: {
“on”: true,
“battery”: 86,
“reachable”: true,
“alert”: “none”,
“tholddark”: 9604,
“tholdoffset”: 7000,
“ledindication”: false,
“usertest”: false,
“pending”: []
},
- Please post configurations (if applicable):
- Items configuration related to the issue
//sample item for Hue sensor
Number HUE_HueSensorConfig_tholddark_MasterBedroom "HUE_HueSensorConfig_tholddark_MasterBedroom[%d]" <Batterylevel> (gSkur) { http="<[HTTP://10.0.0.126/api/API KEYD/sensors/28:300000:JS(getHueSensorConfig_tholddark.js)]"}
// so my new item would look something liek htis
String SFBayAirbnbGuestName "Airbnb Guest Name" <> (gSkur) { http="<[HTTP://sfbayairbnb.com/300000:JS(getSFBayAirbnbGuestName.js)]"}
-
Sitemap configuration related to the issue n/a
-
Rules code related to the issue
-
Services configuration related to the issue
hue Binding -
If logs where generated please post these here using code fences: