We have moved at community.getvera.com

Author Topic: Startup LUA, empty or not ?  (Read 194 times)

Offline Cor

  • Hero Member
  • *****
  • Posts: 1249
  • Karma: +8/-4
Startup LUA, empty or not ?
« on: March 15, 2019, 04:35:16 am »
Greetings,

When I got my vera plus some years ago I inserted a startup LUA to see the currect temperature in my thermostat file:
Code: [Select]
-- list of { temperature_sensor_device_id, { list of Danfoss_LC_device_id } }
 
devices_to_synchronize = { { 45, { 35      } }  }  -- living room
 
 
function synchronize_temp( lul_device, lul_service, lul_variable, lul_value_old, lul_value_new )
 
 for i = 1,#devices_to_synchronize
  do
 
   if devices_to_synchronize[ i ][ 1 ] == tonumber( lul_device )
    then
 
     for j = 1,#devices_to_synchronize[ i ][ 2 ]
       do
        luup.variable_set( 'urn:upnp-org:serviceId:TemperatureSensor1', 'CurrentTemperature', lul_value_new, devices_to_synchronize[ i ][ 2 ][ j ] )
       end
 
    end
 
  end
 
end -- synchronize_temp
 
 
for i = 1,#devices_to_synchronize
 do
  luup.variable_watch( 'synchronize_temp', 'urn:upnp-org:serviceId:TemperatureSensor1', 'CurrentTemperature', devices_to_synchronize[ i ][ 1 ] )
 end

But it didn't work on UI7.

I want to check the hundredsgraphs.com and need to insert something in the startup LUA, when I go to the apps> developp apps> startup LUA , it is empty . Does this mean there is no startup LUA? or when I insert there something is it added to the current startup LUA, in that case, how do I see (and delete) my previous lua  code?

thanks,
Cor

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: Startup LUA, empty or not ?
« Reply #1 on: March 15, 2019, 04:51:26 am »
Startup Lua is stored in the user_data.json file, so anything you put there should remain there across restarts (obviously!) so if you add something later, you should see what you put there earlier.

A factory-reset Vera doesn't, AFAIK, have anything in there to begin with.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1302
  • Karma: +33/-13
Re: Startup LUA, empty or not ?
« Reply #2 on: March 15, 2019, 10:42:49 am »
Does this mean there is no startup LUA?

Yes.  You should be able to see and edit from that screen.  If it is empty, then you don't have anything in startup LUA...
Long Live UI5!  (OK finally made the switch to UI7 in January 2018, and am pretty happy....)

Offline Cor

  • Hero Member
  • *****
  • Posts: 1249
  • Karma: +8/-4
Re: Startup LUA, empty or not ?
« Reply #3 on: March 15, 2019, 11:08:37 am »
@ Akboer @ Wilme2 : awesome... thanks,
Cor