holmes.j
(Jason Holmes)
February 5, 2018, 5:30am
1
I’ve got an openhab cloud instance hosted on a vm instance at google. After I was able to connect I exported a few items to see how things work.
I now want to export additional items, but I can’t get them to sync. The currently exposed items are syncing just fine, but none of the new ones are.
How does syncing work? Is my openhab instance responsible for updating the cloud?
My current config looks like this. Does this look correct?
baseURL="https://openhab.thejholmes.com/"
expose=( \
"kitchen_dimmer", \
"entry_way_switch", \
"backyard_light_switch", \
"family_room_dimmer", \
"guest_bath_dimmer", \
"dining_room_dimmer", \
"nursery_dimmer", \
)
mode="remote"
service.pid="org.openhab.openhabcloud"
rlkoshak
(Rich Koshak)
February 5, 2018, 8:32pm
2
Yes. Your cloud instance will not be aware of the shared Items until there is a change to those Item on your local OH.
1 Like
holmes.j
(Jason Holmes)
February 5, 2018, 10:13pm
3
So what kind of change? I was toggling lights on and off and my cloud instance was definitely not updating. I inserted a few logging statements and it looks like it was getting into itemupdate
. I saw my log messages but only made it so far before I got tired and gave up.
// If no item found for this openhab with this name, create a new one
if (!itemToUpdate) {
logger.info('openHAB-cloud: Item ' + itemName + ' for openHAB ' + openhab.uuid + ' not found, creating new one');
itemToUpdate = new Item({
openhab: openhab.id,
name: itemName,
last_change: new Date,
status: ''
});
}
logger.info("made it here 2");
// If item status changed, update item and create new item status change event
if (itemToUpdate.status !== itemStatus) {
// Update previous status value
itemToUpdate.prev_status = itemToUpdate.status;
// Set new status value
itemToUpdate.status = itemStatus;
// Set last update timestamp to current time
itemToUpdate.last_update = new Date;
// Save the updated item
itemToUpdate.save(function (error) {
rlkoshak
(Rich Koshak)
February 6, 2018, 3:31pm
4
I should just be a change to the Item’s state. An update may be enough. I couldn’t explain why it isn’t working for you.